Trait keeshond::scene::Component [−][src]
pub trait Component: Downcast {
fn maintain_ordering() -> bool
where
Self: Sized,
{ ... }
fn capacity_hint() -> usize
where
Self: Sized,
{ ... }
}
Expand description
A data struct which may be added to an Entity
Provided methods
fn maintain_ordering() -> bool where
Self: Sized,
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,
fn capacity_hint() -> usize where
Self: Sized,
How many components of this type that memory should be reserved for in advance.
Implementations
Returns true if the trait object wraps an object of type __T
.
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.
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.
Returns a reference to the object within the trait object if it is of type __T
, or
None
if it isn’t.
Returns a mutable reference to the object within the trait object if it is of type
__T
, or None
if it isn’t.