Struct oxygengine_core::ecs::shred::cell::TrustCell [−][src]
pub struct TrustCell<T> { /* fields omitted */ }
A custom cell container that is a RefCell
with thread-safety.
Implementations
impl<T> TrustCell<T>
[src]
impl<T> TrustCell<T>
[src]pub fn new(val: T) -> TrustCell<T>
[src]
Create a new cell, similar to RefCell::new
pub fn into_inner(self) -> T
[src]
Consumes this cell and returns ownership of T
.
pub fn borrow(&self) -> Ref<'_, T>
[src]
Get an immutable reference to the inner data.
Absence of write accesses is checked at run-time.
Panics
This function will panic if there is a mutable reference to the data already in use.
pub fn try_borrow(&self) -> Result<Ref<'_, T>, InvalidBorrow>
[src]
Get an immutable reference to the inner data.
Absence of write accesses is checked at run-time. If access is not possible, an error is returned.
pub fn borrow_mut(&self) -> RefMut<'_, T>
[src]
Get a mutable reference to the inner data.
Exclusive access is checked at run-time.
Panics
This function will panic if there are any references to the data already in use.
pub fn try_borrow_mut(&self) -> Result<RefMut<'_, T>, InvalidBorrow>
[src]
Get a mutable reference to the inner data.
Exclusive access is checked at run-time. If access is not possible, an error is returned.
pub fn get_mut(&mut self) -> &mut T
[src]
Gets exclusive access to the inner value, bypassing the Cell.
Exclusive access is checked at compile time.
Trait Implementations
Auto Trait Implementations
impl<T> !RefUnwindSafe for TrustCell<T>
impl<T> !RefUnwindSafe for TrustCell<T>
impl<T> UnwindSafe for TrustCell<T> where
T: UnwindSafe,
impl<T> UnwindSafe for TrustCell<T> where
T: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: Any,
impl<T> Any for T where
T: Any,
pub fn get_type_id(&self) -> TypeId
impl<T> TryDefault for T where
T: Default,
[src]
impl<T> TryDefault for T where
T: Default,
[src]