Struct intrepid_core::State
source · pub struct State<T: Clone>(pub T);Expand description
Retrieve the state an action expects. This has the side-effect of creating a state dependency for the action. All actions in a given system must share the same state type.
Tuple Fields§
§0: TTrait Implementations§
source§impl<StateContents> Extractor<StateContents> for State<StateContents>
impl<StateContents> Extractor<StateContents> for State<StateContents>
source§type Error = Infallible
type Error = Infallible
The error type for this extractor. Anything that can be converted into an extractor error
can be used as an error type. Read more
source§fn extract(
_: Frame,
(_, state): &ExtractContext<StateContents>,
) -> Result<Self, Self::Error>
fn extract( _: Frame, (_, state): &ExtractContext<StateContents>, ) -> Result<Self, Self::Error>
Take an frame and a state and return a result containing the extracted value or the frame.
source§fn extract_from_frame_and_state(
frame: Frame,
context: &ExtractContext<State>,
) -> Result<Self>
fn extract_from_frame_and_state( frame: Frame, context: &ExtractContext<State>, ) -> Result<Self>
Extract a value from a frame and state, returning a result containing the extracted value
or an error coerced into a
crate::Error.Auto Trait Implementations§
impl<T> Freeze for State<T>where
T: Freeze,
impl<T> RefUnwindSafe for State<T>where
T: RefUnwindSafe,
impl<T> Send for State<T>where
T: Send,
impl<T> Sync for State<T>where
T: Sync,
impl<T> Unpin for State<T>where
T: Unpin,
impl<T> UnwindSafe for State<T>where
T: UnwindSafe,
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit)