Struct Access
pub struct Access<'a, T, D = HasSelf<T>>{ /* private fields */ }
Expand description
Provides access to either store data (via the get
method) or the store
itself (via AsContext
/AsContextMut
), as well as the component
instance to which the current host task belongs.
See Accessor::with
for details.
Implementations§
§impl<'a, T, D> Access<'a, T, D>
impl<'a, T, D> Access<'a, T, D>
pub fn spawn(
&mut self,
task: impl AccessorTask<T, D, Result<(), Error>>,
) -> AbortHandlewhere
T: 'static,
pub fn spawn(
&mut self,
task: impl AccessorTask<T, D, Result<(), Error>>,
) -> AbortHandlewhere
T: 'static,
Spawn a background task.
See Accessor::spawn
for details.
Trait Implementations§
§impl<'a, T, D> AsContext for Access<'a, T, D>
impl<'a, T, D> AsContext for Access<'a, T, D>
§fn as_context(&self) -> StoreContext<'_, T>
fn as_context(&self) -> StoreContext<'_, T>
Returns the store context that this type provides access to.
§impl<'a, T, D> AsContextMut for Access<'a, T, D>
impl<'a, T, D> AsContextMut for Access<'a, T, D>
§fn as_context_mut(&mut self) -> StoreContextMut<'_, T>
fn as_context_mut(&mut self) -> StoreContextMut<'_, T>
Returns the store context that this type provides access to.
Auto Trait Implementations§
impl<'a, T, D> Freeze for Access<'a, T, D>where
D: ?Sized,
impl<'a, T, D = HasSelf<T>> !RefUnwindSafe for Access<'a, T, D>
impl<'a, T, D> Send for Access<'a, T, D>
impl<'a, T, D> Sync for Access<'a, T, D>
impl<'a, T, D> Unpin for Access<'a, T, D>where
D: ?Sized,
impl<'a, T, D = HasSelf<T>> !UnwindSafe for Access<'a, T, D>
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more