async_wrap 0.1.10

async_wrap
Documentation

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