pub struct SignalCell<T>{ /* private fields */ }Expand description
A Sync wrapper for single-threaded global Signal access.
SAFETY: This type is only safe to use in single-threaded contexts
(e.g., WASM). It implements Sync to allow usage as a static
variable, but concurrent access from multiple threads would be
undefined behavior.
Implementations§
Source§impl<T> SignalCell<T>
Implementation of SignalCell construction and access.
impl<T> SignalCell<T>
Implementation of SignalCell construction and access.
Source§impl<T> SignalCell<T>
impl<T> SignalCell<T>
pub fn get_mut_inner(&mut self) -> &mut UnsafeCell<Option<Signal<T>>>
Source§impl<T> SignalCell<T>
impl<T> SignalCell<T>
pub fn new(inner: UnsafeCell<Option<Signal<T>>>) -> Self
Trait Implementations§
Source§impl<T> Debug for SignalCell<T>
impl<T> Debug for SignalCell<T>
Source§impl<T> Default for SignalCell<T>
Provides a default empty SignalCell.
impl<T> Default for SignalCell<T>
Provides a default empty SignalCell.
Creates a SignalCell with None stored in the inner UnsafeCell.
§Returns
Self: An emptySignalCellwith no signal stored.
impl<T> Sync for SignalCell<T>
Marks SignalCell as Sync for single-threaded WASM contexts.
SAFETY: SignalCell is only used in single-threaded WASM contexts.
Concurrent access from multiple threads would be undefined behavior.
Auto Trait Implementations§
impl<T> !Freeze for SignalCell<T>
impl<T> !RefUnwindSafe for SignalCell<T>
impl<T> Send for SignalCell<T>
impl<T> Unpin for SignalCell<T>
impl<T> UnsafeUnpin for SignalCell<T>
impl<T> UnwindSafe for SignalCell<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