3 releases

Uses new Rust 2024

0.1.10 Jan 23, 2025
0.1.9 Jan 22, 2025
0.1.8 Jan 9, 2025

#16 in #deref


Used in 2 crates (via static_)

MulanPSL-2.0

11KB

async_wrap

use std::ops::Deref;

pub use tokio::sync::OnceCell;

pub struct Wrap<T: 'static>(pub &'static OnceCell<T>);

impl<T: 'static> Deref for Wrap<T> {
  type Target = T;
  fn deref(&self) -> &Self::Target {
    self.0.get().unwrap()
  }
}

About

This project is an open-source component of i18n.site ⋅ Internationalization Solution.

关于

本项目为 i18n.site ⋅ 国际化解决方案 的开源组件。

Dependencies

~3.5–8.5MB
~59K SLoC