pub struct StaticContext<T> {
inner: UnsafeCell<Option<T>>,
}Expand description
StaticContext provides a context with Send & Sync for use with static instances of ForeignRc.
Fields§
§inner: UnsafeCell<Option<T>>Implementations§
Source§impl<T: Clone> StaticContext<T>
impl<T: Clone> StaticContext<T>
pub const fn new() -> Self
Sourcepub unsafe fn set(&self, val: T)
pub unsafe fn set(&self, val: T)
§Safety
Users of StaticContext::set() must ensure that
their calls into them are not done concurrently.
Sourcepub unsafe fn get(&self) -> Option<T>
pub unsafe fn get(&self) -> Option<T>
§Safety
Users of StaticContext::get() must ensure that
their calls into them are not done concurrently.