pub struct Passengers(/* private fields */);Expand description
Automatically maintained on a vehicle entity; lists the entities currently riding it.
This is populated by inserting
Riding on passenger entities.
You can access the passenger entities using .iter()
Trait Implementations§
Source§impl Component for Passengers
impl Component for Passengers
Source§const STORAGE_TYPE: StorageType = bevy_ecs::component::StorageType::Table
const STORAGE_TYPE: StorageType = bevy_ecs::component::StorageType::Table
A constant indicating the storage type used for this component.
Source§type Mutability = Mutable
type Mutability = Mutable
A marker type to assist Bevy with determining if this component is
mutable, or immutable. Mutable components will have [
Component<Mutability = Mutable>],
while immutable components will instead have [Component<Mutability = Immutable>]. Read moreSource§fn register_required_components(
_requiree: ComponentId,
required_components: &mut RequiredComponentsRegistrator<'_, '_>,
)
fn register_required_components( _requiree: ComponentId, required_components: &mut RequiredComponentsRegistrator<'_, '_>, )
Registers required components. Read more
Source§fn on_discard() -> Option<ComponentHook>
fn on_discard() -> Option<ComponentHook>
Gets the
on_discard [ComponentHook] for this [Component] if one is defined.Source§fn clone_behavior() -> ComponentCloneBehavior
fn clone_behavior() -> ComponentCloneBehavior
Called when registering this component, allowing to override clone function (or disable cloning altogether) for this component. Read more
Source§fn map_entities<M: EntityMapper>(this: &mut Self, mapper: &mut M)
fn map_entities<M: EntityMapper>(this: &mut Self, mapper: &mut M)
Maps the entities on this component using the given [
EntityMapper]. This is used to remap entities in contexts like scenes and entity cloning.
When deriving [Component], this is populated by annotating fields containing entities with #[entities] Read moreSource§fn relationship_accessor() -> Option<ComponentRelationshipAccessor<Self>>
fn relationship_accessor() -> Option<ComponentRelationshipAccessor<Self>>
Returns [
ComponentRelationshipAccessor] required for working with relationships in dynamic contexts. Read more§fn on_add() -> Option<for<'w> fn(DeferredWorld<'w>, HookContext)>
fn on_add() -> Option<for<'w> fn(DeferredWorld<'w>, HookContext)>
Gets the
on_add [ComponentHook] for this [Component] if one is defined.§fn on_insert() -> Option<for<'w> fn(DeferredWorld<'w>, HookContext)>
fn on_insert() -> Option<for<'w> fn(DeferredWorld<'w>, HookContext)>
Gets the
on_insert [ComponentHook] for this [Component] if one is defined.§fn on_remove() -> Option<for<'w> fn(DeferredWorld<'w>, HookContext)>
fn on_remove() -> Option<for<'w> fn(DeferredWorld<'w>, HookContext)>
Gets the
on_remove [ComponentHook] for this [Component] if one is defined.§fn on_despawn() -> Option<for<'w> fn(DeferredWorld<'w>, HookContext)>
fn on_despawn() -> Option<for<'w> fn(DeferredWorld<'w>, HookContext)>
Gets the
on_despawn [ComponentHook] for this [Component] if one is defined.Source§impl Debug for Passengers
impl Debug for Passengers
Source§impl RelationshipTarget for Passengers
impl RelationshipTarget for Passengers
Source§const LINKED_SPAWN: bool = false
const LINKED_SPAWN: bool = false
If this is true, when despawning or cloning (when linked cloning is enabled), the related entities targeting this entity will also be despawned or cloned. Read more
Source§type Relationship = Riding
type Relationship = Riding
The [
Relationship] that populates this [RelationshipTarget] collection.Source§type Collection = Vec<Entity>
type Collection = Vec<Entity>
The collection type that stores the “source” entities for this [
RelationshipTarget] component. Read moreSource§fn collection(&self) -> &Self::Collection
fn collection(&self) -> &Self::Collection
Returns a reference to the stored [
RelationshipTarget::Collection].Source§fn collection_mut_risky(&mut self) -> &mut Self::Collection
fn collection_mut_risky(&mut self) -> &mut Self::Collection
Returns a mutable reference to the stored [
RelationshipTarget::Collection]. Read moreSource§fn from_collection_risky(collection: Self::Collection) -> Self
fn from_collection_risky(collection: Self::Collection) -> Self
§fn on_discard(world: DeferredWorld<'_>, _: HookContext)
fn on_discard(world: DeferredWorld<'_>, _: HookContext)
The
on_discard component hook that maintains the [Relationship] / [RelationshipTarget] connection.§fn on_despawn(world: DeferredWorld<'_>, _: HookContext)
fn on_despawn(world: DeferredWorld<'_>, _: HookContext)
The
on_despawn component hook that despawns entities stored in an entity’s [RelationshipTarget] when
that entity is despawned.§fn with_capacity(capacity: usize) -> Self
fn with_capacity(capacity: usize) -> Self
Creates this [
RelationshipTarget] with the given pre-allocated entity capacity.Auto Trait Implementations§
impl Freeze for Passengers
impl RefUnwindSafe for Passengers
impl Send for Passengers
impl Sync for Passengers
impl Unpin for Passengers
impl UnsafeUnpin for Passengers
impl UnwindSafe for Passengers
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<C> Bundle for Cwhere
C: Component,
impl<C> Bundle for Cwhere
C: Component,
fn component_ids( components: &mut ComponentsRegistrator<'_>, ) -> impl Iterator<Item = ComponentId> + use<C>
§fn get_component_ids(
components: &Components,
) -> impl Iterator<Item = Option<ComponentId>>
fn get_component_ids( components: &Components, ) -> impl Iterator<Item = Option<ComponentId>>
Return a iterator over this [
Bundle]’s component ids. This will be None if the component has not been registered.§impl<C> BundleFromComponents for Cwhere
C: Component,
impl<C> BundleFromComponents for Cwhere
C: Component,
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§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.§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.§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.§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.§impl<T> DowncastSend for T
impl<T> DowncastSend for T
§impl<C> DynamicBundle for Cwhere
C: Component,
impl<C> DynamicBundle for Cwhere
C: Component,
§unsafe fn get_components(
ptr: MovingPtr<'_, C>,
func: &mut impl FnMut(StorageType, OwningPtr<'_>),
) -> <C as DynamicBundle>::Effect
unsafe fn get_components( ptr: MovingPtr<'_, C>, func: &mut impl FnMut(StorageType, OwningPtr<'_>), ) -> <C as DynamicBundle>::Effect
Moves the components out of the bundle. Read more
§unsafe fn apply_effect(
_ptr: MovingPtr<'_, MaybeUninit<C>>,
_entity: &mut EntityWorldMut<'_>,
)
unsafe fn apply_effect( _ptr: MovingPtr<'_, MaybeUninit<C>>, _entity: &mut EntityWorldMut<'_>, )
Applies the after-effects of spawning this bundle. Read more
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<T> IntoResult<T> for T
impl<T> IntoResult<T> for T
§fn into_result(self) -> Result<T, RunSystemError>
fn into_result(self) -> Result<T, RunSystemError>
Converts this type into the system output type.
§impl<T> SpawnRelated for Twhere
T: RelationshipTarget,
impl<T> SpawnRelated for Twhere
T: RelationshipTarget,
§fn spawn<L>(
list: L,
) -> SpawnRelatedBundle<<T as RelationshipTarget>::Relationship, L>where
L: SpawnableList<<T as RelationshipTarget>::Relationship>,
fn spawn<L>(
list: L,
) -> SpawnRelatedBundle<<T as RelationshipTarget>::Relationship, L>where
L: SpawnableList<<T as RelationshipTarget>::Relationship>,
Returns a [
Bundle] containing this [RelationshipTarget] component. It also spawns a [SpawnableList] of entities, each related to the bundle’s entity
via [RelationshipTarget::Relationship]. The [RelationshipTarget] (when possible) will pre-allocate space for the related entities. Read more§fn spawn_one<B>(
bundle: B,
) -> SpawnOneRelated<<T as RelationshipTarget>::Relationship, B>where
B: Bundle,
fn spawn_one<B>(
bundle: B,
) -> SpawnOneRelated<<T as RelationshipTarget>::Relationship, B>where
B: Bundle,
Returns a [
Bundle] containing this [RelationshipTarget] component. It also spawns a single entity containing [Bundle] that is related to the bundle’s entity
via [RelationshipTarget::Relationship]. Read more