pub struct RacyCell<T>(/* private fields */);
Expand description
Internal replacement for static mut T
Used to represent RTIC Resources
Soundness:
-
Unsafe API for internal use only
-
get_mut(&self) -> *mut T
returns a raw mutable pointer to the inner T casting to &mut T is under control of RTIC RTIC ensures &mut T to be unique under Rust aliasing rules.Implementation uses the underlying
UnsafeCell<T>
self.0.get() -> *mut T -
get(&self) -> *const T returns a raw immutable (const) pointer to the inner T casting to &T is under control of RTIC RTIC ensures &T to be shared under Rust aliasing rules.
Implementation uses the underlying
UnsafeCell<T>
self.0.get() -> *mut T, demoted to *const T
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl<T> !Freeze for RacyCell<T>
impl<T> !RefUnwindSafe for RacyCell<T>
impl<T> Send for RacyCell<T>where
T: Send,
impl<T> Unpin for RacyCell<T>where
T: Unpin,
impl<T> UnwindSafe for RacyCell<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