pub struct Intents<A: UiAction> { /* private fields */ }Expand description
The actions drained for the current tick, consumed by the systems that answer them.
Order is the order the controls were clicked. take consumes
one occurrence and reports whether it was there, which is what replaces a
per-action boolean: if intents.retry becomes if intents.take(&UiAction::Retry).
Implementations§
Source§impl<A: UiAction> Intents<A>
impl<A: UiAction> Intents<A>
pub fn new() -> Self
pub fn is_empty(&self) -> bool
pub fn len(&self) -> usize
Sourcepub fn extend(&mut self, actions: impl IntoIterator<Item = A>) -> usize
pub fn extend(&mut self, actions: impl IntoIterator<Item = A>) -> usize
Add actions in argument order. Returns how many were added.
Sourcepub fn requested(&self, action: &A) -> bool
pub fn requested(&self, action: &A) -> bool
Whether an occurrence is pending, without consuming it.
Sourcepub fn take(&mut self, action: &A) -> bool
pub fn take(&mut self, action: &A) -> bool
Consume one occurrence, reporting whether it was there.
Trait Implementations§
Source§impl<A: UiAction> FromIterator<A> for Intents<A>
impl<A: UiAction> FromIterator<A> for Intents<A>
Source§fn from_iter<T: IntoIterator<Item = A>>(iter: T) -> Self
fn from_iter<T: IntoIterator<Item = A>>(iter: T) -> Self
Creates a value from an iterator. Read more
impl<A: PartialEq + UiAction> StructuralPartialEq for Intents<A>
Auto Trait Implementations§
impl<A> Freeze for Intents<A>
impl<A> RefUnwindSafe for Intents<A>where
Vec<A>: RefUnwindSafe,
impl<A> Send for Intents<A>
impl<A> Sync for Intents<A>
impl<A> Unpin for Intents<A>
impl<A> UnsafeUnpin for Intents<A>where
Vec<A>: UnsafeUnpin,
impl<A> UnwindSafe for Intents<A>where
Vec<A>: 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
impl<T> Brush for T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> ConditionalSend for Twhere
T: Send,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Converts
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Converts
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Converts
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Converts
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSend for T
impl<T> DowncastSend for T
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> FromTemplate for T
impl<T> FromTemplate for T
Source§impl<T> FromWorld for Twhere
T: Default,
impl<T> FromWorld for Twhere
T: Default,
Source§fn from_world(_world: &mut World) -> T
fn from_world(_world: &mut World) -> T
Creates Self using default().
Source§impl<T> IntoResult<T> for T
impl<T> IntoResult<T> for T
Source§fn into_result(self) -> Result<T, RunSystemError>
fn into_result(self) -> Result<T, RunSystemError>
Converts this type into the system output type.
Source§impl<T> Template for T
impl<T> Template for T
Source§fn build_template(
&self,
_context: &mut TemplateContext<'_, '_>,
) -> Result<<T as Template>::Output, BevyError>
fn build_template( &self, _context: &mut TemplateContext<'_, '_>, ) -> Result<<T as Template>::Output, BevyError>
Uses this template and the given
entity context to produce a Template::Output.Source§fn clone_template(&self) -> T
fn clone_template(&self) -> T
Clones this template. See
Clone.Source§impl<T> TypeData for T
impl<T> TypeData for T
Source§fn clone_type_data(&self) -> Box<dyn TypeData>
fn clone_type_data(&self) -> Box<dyn TypeData>
Creates a type-erased clone of
self.