Struct hecs_schedule::context::Context
source · [−]pub struct Context<'a> { /* private fields */ }Expand description
Holds all data necessary for the execution of the world. The data is held by references, and needs to outlive the context itself
Implementations
sourceimpl<'a> Context<'a>
impl<'a> Context<'a>
sourcepub fn new(data: &'a dyn Data) -> Context<'_>
pub fn new(data: &'a dyn Data) -> Context<'_>
Construct a new context from the tuple of references data
sourcepub fn borrow<T>(&'a self) -> Result<T::Target> where
T: ContextBorrow<'a>,
pub fn borrow<T>(&'a self) -> Result<T::Target> where
T: ContextBorrow<'a>,
Borrows data of type T from the context. Does not panic.
sourcepub fn cell<T: IntoAccess>(&'a self) -> Result<&AtomicRefCell<NonNull<u8>>>
pub fn cell<T: IntoAccess>(&'a self) -> Result<&AtomicRefCell<NonNull<u8>>>
Returns the cell associated to T.
Note: Types are erased, but casting is guaranteed to be correct.
Trait Implementations
impl Send for Context<'_>
impl Sync for Context<'_>
Auto Trait Implementations
impl<'a> !RefUnwindSafe for Context<'a>
impl<'a> Unpin for Context<'a>
impl<'a> !UnwindSafe for Context<'a>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more