pub struct StaticCell<T> { /* private fields */ }Expand description
A no_std init-once container designed for the oveRTOS lifecycle.
const fn new()— usable instaticdeclarationsinit()— set value (panics if already set)get()— get reference (panics if not set)try_get()— non-panicking variantshutdown()— drop contained value, mark uninitialized
§Safety contract
init() and shutdown() must be called single-threaded (framework lifecycle
guarantee: on_init / on_shutdown). Between init and shutdown the value is
immutable — no data race is possible.
Implementations§
Source§impl<T> StaticCell<T>
impl<T> StaticCell<T>
Trait Implementations§
Source§impl<T> Deref for StaticCell<T>
impl<T> Deref for StaticCell<T>
impl<T: Send> Send for StaticCell<T>
impl<T: Send + Sync> Sync for StaticCell<T>
Auto Trait Implementations§
impl<T> !Freeze for StaticCell<T>
impl<T> !RefUnwindSafe for StaticCell<T>
impl<T> Unpin for StaticCell<T>where
T: Unpin,
impl<T> UnwindSafe for StaticCell<T>where
T: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more