pub struct InterruptCell<T> { /* private fields */ }
Expand description
A fast, thread-local cell that can be safely shared accross interrupt contexts
§Warning
This cell must not be accessed from another thread; doing so will raise a panic.
Implementations§
Source§impl<T> InterruptCell<T>
impl<T> InterruptCell<T>
Sourcepub const fn new_with_threadid(value: T, thread_id: usize) -> Self
pub const fn new_with_threadid(value: T, thread_id: usize) -> Self
Creates a new thread-local cell
Sourcepub fn scope<F, FR>(&self, scope: F) -> FR
pub fn scope<F, FR>(&self, scope: F) -> FR
Provides scoped access to the underlying value
§Panic
This function will panic if called from another thread or interrupt context
Source§impl<T> InterruptCell<LazyCell<T>>
impl<T> InterruptCell<LazyCell<T>>
Sourcepub fn lazy_scope<F, FR>(&self, scope: F) -> FR
pub fn lazy_scope<F, FR>(&self, scope: F) -> FR
Provides scoped access to the underlying lazy cell
§Panic
This function will panic if called from another thread or interrupt context
Trait Implementations§
Source§impl<T> Debug for InterruptCell<T>where
T: Debug,
impl<T> Debug for InterruptCell<T>where
T: Debug,
impl<T> Sync for InterruptCell<T>where
T: Send,
Auto Trait Implementations§
impl<T> !Freeze for InterruptCell<T>
impl<T> !RefUnwindSafe for InterruptCell<T>
impl<T> Send for InterruptCell<T>where
T: Send,
impl<T> Unpin for InterruptCell<T>where
T: Unpin,
impl<T> UnwindSafe for InterruptCell<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