async_wrap

Crates.ioasync_wrap
lib.rsasync_wrap
version0.1.10
created_at2025-01-09 05:59:06.076916+00
updated_at2025-01-23 03:52:21.720034+00
descriptionasync_wrap
homepagehttps://github.com/i18n-site/rust/tree/main/async_wrap
repositoryhttps://github.com/i18n-site/rust.git
max_upload_size
id1509630
size20,018
i18n.site (i18nsite)

documentation

README

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 ⋅ 国际化解决方案 的开源组件。

Commit count: 68

cargo fmt