[][src]Trait keeshond::scene::Component

pub trait Component: Downcast {
    fn maintain_ordering() -> bool
    where
        Self: Sized
, { ... }
fn capacity_hint() -> usize
    where
        Self: Sized
, { ... } }

A data struct which may be added to an Entity

Provided methods

fn maintain_ordering() -> bool where
    Self: Sized

Whether to maintain insertion order when removing components. By default, the slower method that maintains ordering is used. The performance penalty is based on the size of the data in the component type, so it is a good idea to disable this for larger components that don't need strict ordering, as the faster swap removal method is used. Keep in mind that this will disturb the iteration order of the components in the store.

fn capacity_hint() -> usize where
    Self: Sized

How many components of this type that memory should be reserved for in advance.

Loading content...

Implementations

impl dyn Component[src]

pub fn is<__T: Component>(&self) -> bool[src]

Returns true if the trait object wraps an object of type __T.

pub fn downcast<__T: Component>(self: Box<Self>) -> Result<Box<__T>, Box<Self>>[src]

Returns a boxed object from a boxed trait object if the underlying object is of type __T. Returns the original boxed trait if it isn't.

pub fn downcast_rc<__T: Component>(self: Rc<Self>) -> Result<Rc<__T>, Rc<Self>>[src]

Returns an Rc-ed object from an Rc-ed trait object if the underlying object is of type __T. Returns the original Rc-ed trait if it isn't.

pub fn downcast_ref<__T: Component>(&self) -> Option<&__T>[src]

Returns a reference to the object within the trait object if it is of type __T, or None if it isn't.

pub fn downcast_mut<__T: Component>(&mut self) -> Option<&mut __T>[src]

Returns a mutable reference to the object within the trait object if it is of type __T, or None if it isn't.

Implementors

Loading content...