Struct amethyst::shred::cell::TrustCell[]

pub struct TrustCell<T> { /* fields omitted */ }

A custom cell container that is a RefCell with thread-safety.

Methods

impl<T> TrustCell<T>

Create a new cell, similar to RefCell::new

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.

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.

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.

Get a mutable reference to the inner data.

Exclusive access is checked at run-time. If access is not possible, an error is returned.

Important traits for &'a mut R

Gets exclusive access to the inner value, bypassing the Cell.

Exclusive access is checked at compile time.

Trait Implementations

impl<T> Default for TrustCell<T> where
    T: Default

Returns the "default value" for a type. Read more

impl<T> Debug for TrustCell<T> where
    T: Debug

Formats the value using the given formatter. Read more

impl<T> Sync for TrustCell<T> where
    T: Sync

Auto Trait Implementations

impl<T> Send for TrustCell<T> where
    T: Send