pub struct PrepareContext<'a, T: RuntimeFactors, F: Factor> { /* private fields */ }
Expand description
A PrepareContext is passed to Factor::prepare
.
This gives the factor access to app state and the app component.
Implementations§
Source§impl<'a, T: RuntimeFactors, F: Factor> PrepareContext<'a, T, F>
impl<'a, T: RuntimeFactors, F: Factor> PrepareContext<'a, T, F>
Sourcepub fn app_component(&self) -> &'a AppComponent<'_>
pub fn app_component(&self) -> &'a AppComponent<'_>
Get the app component.
Sourcepub fn instance_builder<U: Factor>(&mut self) -> Result<&mut U::InstanceBuilder>
pub fn instance_builder<U: Factor>(&mut self) -> Result<&mut U::InstanceBuilder>
Returns the prepared FactorInstanceBuilder
for the given Factor
.
Fails if the current RuntimeFactors
does not include the given
Factor
or if the given Factor
’s builder has not been prepared
yet (because it is sequenced after this factor).
Auto Trait Implementations§
impl<'a, T, F> Freeze for PrepareContext<'a, T, F>
impl<'a, T, F> RefUnwindSafe for PrepareContext<'a, T, F>where
<F as Factor>::AppState: RefUnwindSafe,
<T as RuntimeFactors>::InstanceBuilders: RefUnwindSafe,
impl<'a, T, F> Send for PrepareContext<'a, T, F>
impl<'a, T, F> Sync for PrepareContext<'a, T, F>
impl<'a, T, F> Unpin for PrepareContext<'a, T, F>
impl<'a, T, F> !UnwindSafe for PrepareContext<'a, T, F>
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