Struct rustpython_common::static_cell::StaticCell
source · pub struct StaticCell<T: 'static> { /* private fields */ }
Implementations§
source§impl<T> StaticCell<T>
impl<T> StaticCell<T>
pub fn get(&'static self) -> Option<&'static T>
pub fn set(&'static self, value: T) -> Result<(), T>
pub fn get_or_init<F>(&'static self, f: F) -> &'static Twhere
F: FnOnce() -> T,
pub fn get_or_try_init<F, E>(&'static self, f: F) -> Result<&'static T, E>
Auto Trait Implementations§
impl<T> Freeze for StaticCell<T>
impl<T> RefUnwindSafe for StaticCell<T>
impl<T> Send for StaticCell<T>
impl<T> Sync for StaticCell<T>
impl<T> Unpin for StaticCell<T>
impl<T> UnwindSafe for StaticCell<T>
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