pub trait ContextBorrow<'a> {
    type Target;

    // Required method
    fn borrow(context: &'a Context<'_>) -> Result<Self::Target, Error>;
}
Expand description

Helper trait for borrowing either immutably or mutably from context

Required Associated Types§

source

type Target

The resulting type after borrowing from context

Required Methods§

source

fn borrow(context: &'a Context<'_>) -> Result<Self::Target, Error>

Borrow type from context

Implementations on Foreign Types§

source§

impl<'a, T> ContextBorrow<'a> for &'a Twhere T: 'static,

§

type Target = Read<'a, T>

source§

fn borrow( context: &'a Context<'_> ) -> Result<<&'a T as ContextBorrow<'a>>::Target, Error>

source§

impl<'a, T> ContextBorrow<'a> for &'a mut Twhere T: 'static,

§

type Target = Write<'a, T>

source§

fn borrow( context: &'a Context<'_> ) -> Result<<&'a mut T as ContextBorrow<'a>>::Target, Error>

Implementors§

source§

impl<'a, T> ContextBorrow<'a> for Read<'a, T>where T: 'static,

§

type Target = Read<'a, T>

source§

impl<'a, T> ContextBorrow<'a> for SubWorldRaw<AtomicRef<'a, World>, T>

§

type Target = SubWorldRaw<AtomicRef<'a, World>, T>

source§

impl<'a, T> ContextBorrow<'a> for Write<'a, T>where T: 'static,

§

type Target = Write<'a, T>

source§

impl<'a, T> ContextBorrow<'a> for MaybeRead<'a, T>where T: 'static,

§

type Target = MaybeRead<'a, T>

source§

impl<'a, T> ContextBorrow<'a> for MaybeWrite<'a, T>where T: 'static,

§

type Target = MaybeWrite<'a, T>