[]Struct bevy::ecs::State

pub struct State<T> where
    T: Clone
{ /* fields omitted */ }

Implementations

impl<T> State<T> where
    T: Clone

pub fn new(state: T) -> State<T>

pub fn current(&self) -> &T

pub fn previous(&self) -> Option<&T>

pub fn next(&self) -> Option<&T>

pub fn set_next(&mut self, state: T) -> Result<(), StateError>

Queue a state change. This will fail if there is already a state in the queue, or if the given state matches the current state

pub fn overwrite_next(&mut self, state: T) -> Result<(), StateError>

Same as [Self::queue], but there is already a next state, it will be overwritten instead of failing

Trait Implementations

impl<T> Debug for State<T> where
    T: Clone + Debug

impl<T> Deref for State<T> where
    T: Clone

type Target = T

The resulting type after dereferencing.

Auto Trait Implementations

impl<T> RefUnwindSafe for State<T> where
    T: RefUnwindSafe
[src]

impl<T> Send for State<T> where
    T: Send
[src]

impl<T> Sync for State<T> where
    T: Sync
[src]

impl<T> Unpin for State<T> where
    T: Unpin
[src]

impl<T> UnwindSafe for State<T> where
    T: UnwindSafe
[src]

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Any for T where
    T: Any

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Component for T where
    T: 'static + Send + Sync

impl<T> Downcast for T where
    T: Any

impl<T> DowncastSync for T where
    T: Send + Sync + Any

impl<T> From<T> for T[src]

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Resource for T where
    T: 'static + Send + Sync

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,