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: T
Trait Implementations§
Source§impl<StateContents> Extractor<StateContents> for State<StateContents>
impl<StateContents> Extractor<StateContents> for State<StateContents>
Source§type Error = StateNotReadyError
type Error = StateNotReadyError
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,
context: &Context<StateContents>,
) -> Result<Self, Self::Error>
fn extract( _: Frame, context: &Context<StateContents>, ) -> Result<Self, Self::Error>
Take an frame and a state and return a result containing the extracted value or the frame.
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