pub struct ObjectWorldRef<'w, T: Kind = Any, R: Relationship = ChildOf> { /* private fields */ }Implementations§
Source§impl<'w, T: Kind, R: Relationship> ObjectWorldRef<'w, T, R>
impl<'w, T: Kind, R: Relationship> ObjectWorldRef<'w, T, R>
Sourcepub unsafe fn from_any_unchecked(object: ObjectWorldRef<'w, Any, R>) -> Self
pub unsafe fn from_any_unchecked(object: ObjectWorldRef<'w, Any, R>) -> Self
Creates a new ObjectWorldRef<T> from an ObjectWorldRef<Any>.
This is semantically equivalent to an unsafe downcast.
§Safety
Assumes object is of Kind T.
Sourcepub fn from_any(object: ObjectWorldRef<'w, Any, R>) -> Option<Self>where
T: Component,
pub fn from_any(object: ObjectWorldRef<'w, Any, R>) -> Option<Self>where
T: Component,
Creates a new ObjectWorldRef<T> from an ObjectWorldRef<Any> if the object
contains the given Component T.
This is semantically equivalent to a safe downcast.
Sourcepub fn contains<U: Component>(&self) -> bool
pub fn contains<U: Component>(&self) -> bool
See EntityRef::contains.
Sourcepub fn instance(&self) -> Instance<T>
pub fn instance(&self) -> Instance<T>
Returns the object as an Instance<T>.
Trait Implementations§
Source§impl<T: Kind, R: Relationship> Clone for ObjectWorldRef<'_, T, R>
impl<T: Kind, R: Relationship> Clone for ObjectWorldRef<'_, T, R>
Source§impl<T: Kind, R: Relationship> ContainsInstance<T> for ObjectWorldRef<'_, T, R>
impl<T: Kind, R: Relationship> ContainsInstance<T> for ObjectWorldRef<'_, T, R>
impl<T: Kind, R: Relationship> Copy for ObjectWorldRef<'_, T, R>
Source§impl<T: Kind, R: Relationship> Debug for ObjectWorldRef<'_, T, R>
impl<T: Kind, R: Relationship> Debug for ObjectWorldRef<'_, T, R>
Source§impl<T: Component, R: Relationship> Deref for ObjectWorldRef<'_, T, R>
impl<T: Component, R: Relationship> Deref for ObjectWorldRef<'_, T, R>
Source§impl<T: Kind, R: Relationship> Display for ObjectWorldRef<'_, T, R>
impl<T: Kind, R: Relationship> Display for ObjectWorldRef<'_, T, R>
impl<T: Kind, R: Relationship> Eq for ObjectWorldRef<'_, T, R>
Source§impl<T: Kind, R: Relationship> From<ObjectWorldRef<'_, T, R>> for Entity
impl<T: Kind, R: Relationship> From<ObjectWorldRef<'_, T, R>> for Entity
Source§fn from(object: ObjectWorldRef<'_, T, R>) -> Self
fn from(object: ObjectWorldRef<'_, T, R>) -> Self
Converts to this type from the input type.
Source§impl<T: Kind, R: Relationship> From<ObjectWorldRef<'_, T, R>> for Instance<T>
impl<T: Kind, R: Relationship> From<ObjectWorldRef<'_, T, R>> for Instance<T>
Source§fn from(object: ObjectWorldRef<'_, T, R>) -> Self
fn from(object: ObjectWorldRef<'_, T, R>) -> Self
Converts to this type from the input type.
Source§impl<T: Kind, R: Relationship> ObjectHierarchy<T, R> for ObjectWorldRef<'_, T, R>
impl<T: Kind, R: Relationship> ObjectHierarchy<T, R> for ObjectWorldRef<'_, T, R>
Source§fn parent(&self) -> Option<Self::Rebind<Any, R>>
fn parent(&self) -> Option<Self::Rebind<Any, R>>
Returns the parent of this object, if it exists.
Source§fn children(&self) -> impl Iterator<Item = Self::Rebind<Any, R>>
fn children(&self) -> impl Iterator<Item = Self::Rebind<Any, R>>
Iterates over all children of this object.
Source§fn ancestors(&self) -> impl Iterator<Item = Self::Rebind<Any, R>>
fn ancestors(&self) -> impl Iterator<Item = Self::Rebind<Any, R>>
Iterates over all ancestors of this object.
Source§fn descendants_wide(&self) -> impl Iterator<Item = Self::Rebind<Any, R>>
fn descendants_wide(&self) -> impl Iterator<Item = Self::Rebind<Any, R>>
Iterates over all descendants of this object in breadth-first order.
Source§fn descendants_deep(&self) -> impl Iterator<Item = Self::Rebind<Any, R>>
fn descendants_deep(&self) -> impl Iterator<Item = Self::Rebind<Any, R>>
Iterates over all descendants of this object in depth-first order.
Source§fn find_by_path(&self, path: impl AsRef<str>) -> Option<Self::Rebind<Any, R>>
fn find_by_path(&self, path: impl AsRef<str>) -> Option<Self::Rebind<Any, R>>
Attempts to find an object by its path, relative to this one. Read more
Returns true if this object has the same root as another.
Source§fn is_child_of(&self, entity: Entity) -> bool
fn is_child_of(&self, entity: Entity) -> bool
Returns true if this object is a child of the given
Entity.Source§fn has_children(&self) -> bool
fn has_children(&self) -> bool
Returns true if this object has any children.
Source§fn query_children<'a, Q: QueryData, F: QueryFilter>(
&'a self,
query: &'a Query<'_, '_, Q, F>,
) -> impl Iterator<Item = QueryItem<'a, 'a, Q::ReadOnly>> + 'a
fn query_children<'a, Q: QueryData, F: QueryFilter>( &'a self, query: &'a Query<'_, '_, Q, F>, ) -> impl Iterator<Item = QueryItem<'a, 'a, Q::ReadOnly>> + 'a
Iterates over all children of this object which match the given
Query.Source§fn children_of_kind<'w, 's, 'a, U: Kind, F2: QueryFilter, R2: Relationship>(
&'a self,
objects: &'a Objects<'w, 's, U, F2, R2>,
) -> impl Iterator<Item = Object<'w, 's, 'a, U, R2>> + 'a
fn children_of_kind<'w, 's, 'a, U: Kind, F2: QueryFilter, R2: Relationship>( &'a self, objects: &'a Objects<'w, 's, U, F2, R2>, ) -> impl Iterator<Item = Object<'w, 's, 'a, U, R2>> + 'a
Iterates over all children of this object which match the given
Kind.Source§fn find_child_of_kind<'w, 's, 'a, U: Kind, F2: QueryFilter, R2: Relationship>(
&self,
objects: &'a Objects<'w, 's, U, F2, R2>,
) -> Option<Object<'w, 's, 'a, U, R2>>
fn find_child_of_kind<'w, 's, 'a, U: Kind, F2: QueryFilter, R2: Relationship>( &self, objects: &'a Objects<'w, 's, U, F2, R2>, ) -> Option<Object<'w, 's, 'a, U, R2>>
Returns the first child of this object which matches the given kind, if it exists.
Source§fn self_and_ancestors(&self) -> impl Iterator<Item = Self::Rebind<Any, R>>
fn self_and_ancestors(&self) -> impl Iterator<Item = Self::Rebind<Any, R>>
Iterates over this object, followed by all of its ancestors.
Source§fn is_ancestor_of<U: Kind>(&self, other: &impl ObjectHierarchy<U, R>) -> bool
fn is_ancestor_of<U: Kind>(&self, other: &impl ObjectHierarchy<U, R>) -> bool
Returns true if this object is an ancestor of another.
Source§fn query_ancestors<'a, Q: QueryData, F: QueryFilter>(
&'a self,
query: &'a Query<'_, '_, Q, F>,
) -> impl Iterator<Item = QueryItem<'a, 'a, Q::ReadOnly>> + 'a
fn query_ancestors<'a, Q: QueryData, F: QueryFilter>( &'a self, query: &'a Query<'_, '_, Q, F>, ) -> impl Iterator<Item = QueryItem<'a, 'a, Q::ReadOnly>> + 'a
Iterates over all ancestors of this object which match the given
Query.Source§fn query_self_and_ancestors<'a, Q: QueryData, F: QueryFilter>(
&'a self,
query: &'a Query<'_, '_, Q, F>,
) -> impl Iterator<Item = QueryItem<'a, 'a, Q::ReadOnly>> + 'a
fn query_self_and_ancestors<'a, Q: QueryData, F: QueryFilter>( &'a self, query: &'a Query<'_, '_, Q, F>, ) -> impl Iterator<Item = QueryItem<'a, 'a, Q::ReadOnly>> + 'a
Iterates over this object, followed by all its ancestors which match the given
Query.Source§fn ancestors_of_kind<'w, 's, 'a, U: Kind, F2: QueryFilter, R2: Relationship>(
&'a self,
objects: &'a Objects<'w, 's, U, F2, R2>,
) -> impl Iterator<Item = Object<'w, 's, 'a, U, R2>>
fn ancestors_of_kind<'w, 's, 'a, U: Kind, F2: QueryFilter, R2: Relationship>( &'a self, objects: &'a Objects<'w, 's, U, F2, R2>, ) -> impl Iterator<Item = Object<'w, 's, 'a, U, R2>>
Iterates over all ancestors of this object which match the given
Kind.Source§fn self_and_ancestors_of_kind<'w, 's, 'a, U: Kind, F2: QueryFilter, R2: Relationship>(
&'a self,
objects: &'a Objects<'w, 's, U, F2, R2>,
) -> impl Iterator<Item = Object<'w, 's, 'a, U, R2>>
fn self_and_ancestors_of_kind<'w, 's, 'a, U: Kind, F2: QueryFilter, R2: Relationship>( &'a self, objects: &'a Objects<'w, 's, U, F2, R2>, ) -> impl Iterator<Item = Object<'w, 's, 'a, U, R2>>
Iterates over this object, followed by all its ancestors which match the given
Kind.Source§fn find_ancestor_of_kind<'w, 's, 'a, U: Kind, F2: QueryFilter, R2: Relationship>(
&self,
objects: &'a Objects<'w, 's, U, F2, R2>,
) -> Option<Object<'w, 's, 'a, U, R2>>
fn find_ancestor_of_kind<'w, 's, 'a, U: Kind, F2: QueryFilter, R2: Relationship>( &self, objects: &'a Objects<'w, 's, U, F2, R2>, ) -> Option<Object<'w, 's, 'a, U, R2>>
Returns the first ancestor of this object which matches the given
Kind, if it exists.Source§fn self_and_descendants_wide(
&self,
) -> impl Iterator<Item = Self::Rebind<Any, R>>
fn self_and_descendants_wide( &self, ) -> impl Iterator<Item = Self::Rebind<Any, R>>
Iterates over this object and all its descendants in breadth-first order.
Source§fn self_and_descendants_deep(
&self,
) -> impl Iterator<Item = Self::Rebind<Any, R>>
fn self_and_descendants_deep( &self, ) -> impl Iterator<Item = Self::Rebind<Any, R>>
Iterates over this object and all its descendants in depth-first order.
Source§fn is_descendant_of(&self, entity: Entity) -> bool
fn is_descendant_of(&self, entity: Entity) -> bool
Returns true if this object is a descendant of the given entity.
Source§fn descendants_of_kind_wide<'w, 's, 'a, U: Kind, F2: QueryFilter, R2: Relationship>(
&'a self,
objects: &'a Objects<'w, 's, U, F2, R2>,
) -> impl Iterator<Item = Object<'w, 's, 'a, U, R2>>
fn descendants_of_kind_wide<'w, 's, 'a, U: Kind, F2: QueryFilter, R2: Relationship>( &'a self, objects: &'a Objects<'w, 's, U, F2, R2>, ) -> impl Iterator<Item = Object<'w, 's, 'a, U, R2>>
Iterates over all descendants of this object which match the given
Kind in breadth-first order.Source§fn descendants_of_kind_deep<'w, 's, 'a, U: Kind, F2: QueryFilter, R2: Relationship>(
&'a self,
objects: &'a Objects<'w, 's, U, F2, R2>,
) -> impl Iterator<Item = Object<'w, 's, 'a, U, R2>>
fn descendants_of_kind_deep<'w, 's, 'a, U: Kind, F2: QueryFilter, R2: Relationship>( &'a self, objects: &'a Objects<'w, 's, U, F2, R2>, ) -> impl Iterator<Item = Object<'w, 's, 'a, U, R2>>
Iterates over all descendants of this object which match the given
Kind in depth-first order.Source§fn self_and_descendants_of_kind_wide<'w, 's, 'a, U: Kind, F2: QueryFilter, R2: Relationship>(
&'a self,
objects: &'a Objects<'w, 's, U, F2, R2>,
) -> impl Iterator<Item = Object<'w, 's, 'a, U, R2>>
fn self_and_descendants_of_kind_wide<'w, 's, 'a, U: Kind, F2: QueryFilter, R2: Relationship>( &'a self, objects: &'a Objects<'w, 's, U, F2, R2>, ) -> impl Iterator<Item = Object<'w, 's, 'a, U, R2>>
Iterates over this object, followed by all its descendants which match the given
Kind in breadth-first order.Source§fn self_and_descendants_of_kind_deep<'w, 's, 'a, U: Kind, F2: QueryFilter, R2: Relationship>(
&'a self,
objects: &'a Objects<'w, 's, U, F2, R2>,
) -> impl Iterator<Item = Object<'w, 's, 'a, U, R2>>
fn self_and_descendants_of_kind_deep<'w, 's, 'a, U: Kind, F2: QueryFilter, R2: Relationship>( &'a self, objects: &'a Objects<'w, 's, U, F2, R2>, ) -> impl Iterator<Item = Object<'w, 's, 'a, U, R2>>
Iterates over this object, followed by all its descendants which match the given
Kind in depth-first order.Source§fn query_descendants_wide<'a, Q: QueryData, F: QueryFilter>(
&'a self,
query: &'a Query<'_, '_, Q, F>,
) -> impl Iterator<Item = QueryItem<'a, 'a, Q::ReadOnly>> + 'a
fn query_descendants_wide<'a, Q: QueryData, F: QueryFilter>( &'a self, query: &'a Query<'_, '_, Q, F>, ) -> impl Iterator<Item = QueryItem<'a, 'a, Q::ReadOnly>> + 'a
Iterates over all descendants of this object which match the given
Query in breadth-first order.Source§fn query_descendants_deep<'a, Q: QueryData, F: QueryFilter>(
&'a self,
query: &'a Query<'_, '_, Q, F>,
) -> impl Iterator<Item = QueryItem<'a, 'a, Q::ReadOnly>> + 'a
fn query_descendants_deep<'a, Q: QueryData, F: QueryFilter>( &'a self, query: &'a Query<'_, '_, Q, F>, ) -> impl Iterator<Item = QueryItem<'a, 'a, Q::ReadOnly>> + 'a
Iterates over all descendants of this object which match the given
Kind in depth-first order.Source§fn query_self_and_descendants_wide<'a, Q: QueryData, F: QueryFilter>(
&'a self,
query: &'a Query<'_, '_, Q, F>,
) -> impl Iterator<Item = QueryItem<'a, 'a, Q::ReadOnly>> + 'a
fn query_self_and_descendants_wide<'a, Q: QueryData, F: QueryFilter>( &'a self, query: &'a Query<'_, '_, Q, F>, ) -> impl Iterator<Item = QueryItem<'a, 'a, Q::ReadOnly>> + 'a
Iterates over this object, followed by all its descendants which match the given
Query in breadth-first order.Source§fn query_self_and_descendants_deep<'a, Q: QueryData>(
&'a self,
query: &'a Query<'_, '_, Q>,
) -> impl Iterator<Item = QueryItem<'a, 'a, Q::ReadOnly>> + 'a
fn query_self_and_descendants_deep<'a, Q: QueryData>( &'a self, query: &'a Query<'_, '_, Q>, ) -> impl Iterator<Item = QueryItem<'a, 'a, Q::ReadOnly>> + 'a
Iterates over this object, followed by all its descendants which match the given
Query in depth-first order.Source§fn find_descendant_of_kind_wide<'w, 's, 'a, U: Kind, F2: QueryFilter, R2: Relationship>(
&self,
objects: &'a Objects<'w, 's, U, F2, R2>,
) -> Option<Object<'w, 's, 'a, U, R2>>
fn find_descendant_of_kind_wide<'w, 's, 'a, U: Kind, F2: QueryFilter, R2: Relationship>( &self, objects: &'a Objects<'w, 's, U, F2, R2>, ) -> Option<Object<'w, 's, 'a, U, R2>>
Returns the first descendant of this object (breadth-first order) which matches the given
Kind, if it exists.Source§fn find_descendant_of_kind_deep<'w, 's, 'a, U: Kind, F2: QueryFilter, R2: Relationship>(
&self,
objects: &'a Objects<'w, 's, U, F2, R2>,
) -> Option<Object<'w, 's, 'a, U, R2>>
fn find_descendant_of_kind_deep<'w, 's, 'a, U: Kind, F2: QueryFilter, R2: Relationship>( &self, objects: &'a Objects<'w, 's, U, F2, R2>, ) -> Option<Object<'w, 's, 'a, U, R2>>
Returns the first descendant of this object (depth-first order) which matches the given
Kind, if it exists.Source§impl<T: Kind, R: Relationship> ObjectName for ObjectWorldRef<'_, T, R>
impl<T: Kind, R: Relationship> ObjectName for ObjectWorldRef<'_, T, R>
Source§impl<'w, T: Kind, R: Relationship> ObjectRebind<T, R> for ObjectWorldRef<'w, T, R>
impl<'w, T: Kind, R: Relationship> ObjectRebind<T, R> for ObjectWorldRef<'w, T, R>
Source§unsafe fn rebind_any(&self, entity: Entity) -> Self::Rebind<Any, R>
unsafe fn rebind_any(&self, entity: Entity) -> Self::Rebind<Any, R>
Source§fn cast_into_any(self) -> Self::Rebind<Any, R>
fn cast_into_any(self) -> Self::Rebind<Any, R>
Casts this object into an
Object<Any>. Read moreSource§unsafe fn cast_into_unchecked<U: Kind>(self) -> Self::Rebind<U, R>
unsafe fn cast_into_unchecked<U: Kind>(self) -> Self::Rebind<U, R>
Source§fn as_any(&self) -> Self::Rebind<Any, R>
fn as_any(&self) -> Self::Rebind<Any, R>
Returns this object as an
Object<Any>.Source§impl<T: Kind, R: Relationship> ObjectTags for ObjectWorldRef<'_, T, R>
impl<T: Kind, R: Relationship> ObjectTags for ObjectWorldRef<'_, T, R>
Source§impl<T: Kind, R: Relationship> PartialEq<Entity> for ObjectWorldRef<'_, T, R>
impl<T: Kind, R: Relationship> PartialEq<Entity> for ObjectWorldRef<'_, T, R>
Source§impl<T: Kind, R: Relationship> PartialEq<Instance<T>> for ObjectWorldRef<'_, T, R>
impl<T: Kind, R: Relationship> PartialEq<Instance<T>> for ObjectWorldRef<'_, T, R>
Source§impl<T: Kind, R: Relationship> PartialEq<ObjectWorldRef<'_, T, R>> for Instance<T>
impl<T: Kind, R: Relationship> PartialEq<ObjectWorldRef<'_, T, R>> for Instance<T>
Source§fn eq(&self, other: &ObjectWorldRef<'_, T, R>) -> bool
fn eq(&self, other: &ObjectWorldRef<'_, T, R>) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl<T: Kind, R: Relationship> PartialEq<ObjectWorldRef<'_, T, R>> for Entity
impl<T: Kind, R: Relationship> PartialEq<ObjectWorldRef<'_, T, R>> for Entity
Source§fn eq(&self, other: &ObjectWorldRef<'_, T, R>) -> bool
fn eq(&self, other: &ObjectWorldRef<'_, T, R>) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl<T: Kind, U: Kind, R: Relationship> PartialEq<ObjectWorldRef<'_, U, R>> for ObjectWorldRef<'_, T, R>
impl<T: Kind, U: Kind, R: Relationship> PartialEq<ObjectWorldRef<'_, U, R>> for ObjectWorldRef<'_, T, R>
Source§fn eq(&self, other: &ObjectWorldRef<'_, U, R>) -> bool
fn eq(&self, other: &ObjectWorldRef<'_, U, R>) -> bool
Tests for
self and other values to be equal, and is used by ==.Auto Trait Implementations§
impl<'w, T = Any, R = ChildOf> !RefUnwindSafe for ObjectWorldRef<'w, T, R>
impl<'w, T = Any, R = ChildOf> !UnwindSafe for ObjectWorldRef<'w, T, R>
impl<'w, T, R> Freeze for ObjectWorldRef<'w, T, R>
impl<'w, T, R> Send for ObjectWorldRef<'w, T, R>
impl<'w, T, R> Sync for ObjectWorldRef<'w, T, R>
impl<'w, T, R> Unpin for ObjectWorldRef<'w, T, R>
impl<'w, T, R> UnsafeUnpin for ObjectWorldRef<'w, T, R>
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
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
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§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.
impl<T> Static for T
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 this value.