pub struct Object<'w, 's, 'a, T = Any>where
T: Kind,{ /* private fields */ }Implementations§
Source§impl<'w, 's, 'a, T> Object<'w, 's, 'a, T>where
T: Kind,
impl<'w, 's, 'a, T> Object<'w, 's, 'a, T>where
T: Kind,
Sourcepub unsafe fn from_any_unchecked(
object: Object<'w, 's, 'a>,
) -> Object<'w, 's, 'a, T>
pub unsafe fn from_any_unchecked( object: Object<'w, 's, 'a>, ) -> Object<'w, 's, 'a, T>
Creates a new Object<T> from an Object<Any>.
This is semantically equivalent to an unsafe downcast.
§Safety
Assumes base is of Kind T.
Sourcepub fn instance(&self) -> Instance<T>
pub fn instance(&self) -> Instance<T>
Returns the object as an Instance<T>.
Trait Implementations§
Source§impl<T> ContainsInstance<T> for Object<'_, '_, '_, T>where
T: Kind,
impl<T> ContainsInstance<T> for Object<'_, '_, '_, T>where
T: Kind,
Source§impl<T> ObjectHierarchy<T> for Object<'_, '_, '_, T>where
T: Kind,
impl<T> ObjectHierarchy<T> for Object<'_, '_, '_, T>where
T: Kind,
Source§fn parent(
&self,
) -> Option<<Object<'_, '_, '_, T> as ObjectRebind<T>>::Rebind<Any>>
fn parent( &self, ) -> Option<<Object<'_, '_, '_, T> as ObjectRebind<T>>::Rebind<Any>>
Returns the parent of this object, if it exists.
Source§fn children(
&self,
) -> impl Iterator<Item = <Object<'_, '_, '_, T> as ObjectRebind<T>>::Rebind<Any>>
fn children( &self, ) -> impl Iterator<Item = <Object<'_, '_, '_, T> as ObjectRebind<T>>::Rebind<Any>>
Iterates over all children of this object.
Source§fn ancestors(
&self,
) -> impl Iterator<Item = <Object<'_, '_, '_, T> as ObjectRebind<T>>::Rebind<Any>>
fn ancestors( &self, ) -> impl Iterator<Item = <Object<'_, '_, '_, T> as ObjectRebind<T>>::Rebind<Any>>
Iterates over all ancestors of this object.
Source§fn descendants_wide(
&self,
) -> impl Iterator<Item = <Object<'_, '_, '_, T> as ObjectRebind<T>>::Rebind<Any>>
fn descendants_wide( &self, ) -> impl Iterator<Item = <Object<'_, '_, '_, T> as ObjectRebind<T>>::Rebind<Any>>
Iterates over all descendants of this object in breadth-first order.
Source§fn descendants_deep(
&self,
) -> impl Iterator<Item = <Object<'_, '_, '_, T> as ObjectRebind<T>>::Rebind<Any>>
fn descendants_deep( &self, ) -> impl Iterator<Item = <Object<'_, '_, '_, T> as ObjectRebind<T>>::Rebind<Any>>
Iterates over all descendants of this object in depth-first order.
Source§fn find_by_path(
&self,
path: impl AsRef<str>,
) -> Option<<Object<'_, '_, '_, T> as ObjectRebind<T>>::Rebind<Any>>
fn find_by_path( &self, path: impl AsRef<str>, ) -> Option<<Object<'_, '_, '_, T> as ObjectRebind<T>>::Rebind<Any>>
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, F>(
&'a self,
query: &'a Query<'_, '_, Q, F>,
) -> impl Iterator<Item = <<Q as QueryData>::ReadOnly as QueryData>::Item<'a, 'a>> + 'awhere
Q: QueryData,
F: QueryFilter,
fn query_children<'a, Q, F>(
&'a self,
query: &'a Query<'_, '_, Q, F>,
) -> impl Iterator<Item = <<Q as QueryData>::ReadOnly as QueryData>::Item<'a, 'a>> + 'awhere
Q: QueryData,
F: QueryFilter,
Iterates over all children of this object which match the given
Query.Source§fn children_of_kind<'w, 's, 'a, U>(
&'a self,
objects: &'a Objects<'w, 's, U>,
) -> impl Iterator<Item = Object<'w, 's, 'a, U>> + 'awhere
U: Kind,
fn children_of_kind<'w, 's, 'a, U>(
&'a self,
objects: &'a Objects<'w, 's, U>,
) -> impl Iterator<Item = Object<'w, 's, 'a, U>> + 'awhere
U: Kind,
Iterates over all children of this object which match the given
Kind.Source§fn find_child_of_kind<'w, 's, 'a, U>(
&self,
objects: &'a Objects<'w, 's, U>,
) -> Option<Object<'w, 's, 'a, U>>where
U: Kind,
fn find_child_of_kind<'w, 's, 'a, U>(
&self,
objects: &'a Objects<'w, 's, U>,
) -> Option<Object<'w, 's, 'a, U>>where
U: Kind,
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>>
fn self_and_ancestors(&self) -> impl Iterator<Item = Self::Rebind<Any>>
Iterates over this object, followed by all of its ancestors.
Source§fn is_ancestor_of<U>(&self, other: &impl ObjectHierarchy<U>) -> bool
fn is_ancestor_of<U>(&self, other: &impl ObjectHierarchy<U>) -> bool
Returns true if this object is an ancestor of another.
Source§fn query_ancestors<'a, Q, F>(
&'a self,
query: &'a Query<'_, '_, Q, F>,
) -> impl Iterator<Item = <<Q as QueryData>::ReadOnly as QueryData>::Item<'a, 'a>> + 'awhere
Q: QueryData,
F: QueryFilter,
fn query_ancestors<'a, Q, F>(
&'a self,
query: &'a Query<'_, '_, Q, F>,
) -> impl Iterator<Item = <<Q as QueryData>::ReadOnly as QueryData>::Item<'a, 'a>> + 'awhere
Q: QueryData,
F: QueryFilter,
Iterates over all ancestors of this object which match the given
Query.Source§fn query_self_and_ancestors<'a, Q, F>(
&'a self,
query: &'a Query<'_, '_, Q, F>,
) -> impl Iterator<Item = <<Q as QueryData>::ReadOnly as QueryData>::Item<'a, 'a>> + 'awhere
Q: QueryData,
F: QueryFilter,
fn query_self_and_ancestors<'a, Q, F>(
&'a self,
query: &'a Query<'_, '_, Q, F>,
) -> impl Iterator<Item = <<Q as QueryData>::ReadOnly as QueryData>::Item<'a, 'a>> + 'awhere
Q: QueryData,
F: QueryFilter,
Iterates over this object, followed by all its ancestors which match the given
Query.Source§fn ancestors_of_kind<'w, 's, 'a, U>(
&'a self,
objects: &'a Objects<'w, 's, U>,
) -> impl Iterator<Item = Object<'w, 's, 'a, U>>where
U: Kind,
fn ancestors_of_kind<'w, 's, 'a, U>(
&'a self,
objects: &'a Objects<'w, 's, U>,
) -> impl Iterator<Item = Object<'w, 's, 'a, U>>where
U: Kind,
Iterates over all ancestors of this object which match the given
Kind.Source§fn self_and_ancestors_of_kind<'w, 's, 'a, U>(
&'a self,
objects: &'a Objects<'w, 's, U>,
) -> impl Iterator<Item = Object<'w, 's, 'a, U>>where
U: Kind,
fn self_and_ancestors_of_kind<'w, 's, 'a, U>(
&'a self,
objects: &'a Objects<'w, 's, U>,
) -> impl Iterator<Item = Object<'w, 's, 'a, U>>where
U: Kind,
Iterates over this object, followed by all its ancestors which match the given
Kind.Source§fn find_ancestor_of_kind<'w, 's, 'a, U>(
&self,
objects: &'a Objects<'w, 's, U>,
) -> Option<Object<'w, 's, 'a, U>>where
U: Kind,
fn find_ancestor_of_kind<'w, 's, 'a, U>(
&self,
objects: &'a Objects<'w, 's, U>,
) -> Option<Object<'w, 's, 'a, U>>where
U: Kind,
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>>
fn self_and_descendants_wide(&self) -> impl Iterator<Item = Self::Rebind<Any>>
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>>
fn self_and_descendants_deep(&self) -> impl Iterator<Item = Self::Rebind<Any>>
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>(
&'a self,
objects: &'a Objects<'w, 's, U>,
) -> impl Iterator<Item = Object<'w, 's, 'a, U>>where
U: Kind,
fn descendants_of_kind_wide<'w, 's, 'a, U>(
&'a self,
objects: &'a Objects<'w, 's, U>,
) -> impl Iterator<Item = Object<'w, 's, 'a, U>>where
U: Kind,
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>(
&'a self,
objects: &'a Objects<'w, 's, U>,
) -> impl Iterator<Item = Object<'w, 's, 'a, U>>where
U: Kind,
fn descendants_of_kind_deep<'w, 's, 'a, U>(
&'a self,
objects: &'a Objects<'w, 's, U>,
) -> impl Iterator<Item = Object<'w, 's, 'a, U>>where
U: Kind,
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>(
&'a self,
objects: &'a Objects<'w, 's, U>,
) -> impl Iterator<Item = Object<'w, 's, 'a, U>>where
U: Kind,
fn self_and_descendants_of_kind_wide<'w, 's, 'a, U>(
&'a self,
objects: &'a Objects<'w, 's, U>,
) -> impl Iterator<Item = Object<'w, 's, 'a, U>>where
U: Kind,
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>(
&'a self,
objects: &'a Objects<'w, 's, U>,
) -> impl Iterator<Item = Object<'w, 's, 'a, U>>where
U: Kind,
fn self_and_descendants_of_kind_deep<'w, 's, 'a, U>(
&'a self,
objects: &'a Objects<'w, 's, U>,
) -> impl Iterator<Item = Object<'w, 's, 'a, U>>where
U: Kind,
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, F>(
&'a self,
query: &'a Query<'_, '_, Q, F>,
) -> impl Iterator<Item = <<Q as QueryData>::ReadOnly as QueryData>::Item<'a, 'a>> + 'awhere
Q: QueryData,
F: QueryFilter,
fn query_descendants_wide<'a, Q, F>(
&'a self,
query: &'a Query<'_, '_, Q, F>,
) -> impl Iterator<Item = <<Q as QueryData>::ReadOnly as QueryData>::Item<'a, 'a>> + 'awhere
Q: QueryData,
F: QueryFilter,
Iterates over all descendants of this object which match the given
Query in breadth-first order.Source§fn query_descendants_deep<'a, Q, F>(
&'a self,
query: &'a Query<'_, '_, Q, F>,
) -> impl Iterator<Item = <<Q as QueryData>::ReadOnly as QueryData>::Item<'a, 'a>> + 'awhere
Q: QueryData,
F: QueryFilter,
fn query_descendants_deep<'a, Q, F>(
&'a self,
query: &'a Query<'_, '_, Q, F>,
) -> impl Iterator<Item = <<Q as QueryData>::ReadOnly as QueryData>::Item<'a, 'a>> + 'awhere
Q: QueryData,
F: QueryFilter,
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, F>(
&'a self,
query: &'a Query<'_, '_, Q, F>,
) -> impl Iterator<Item = <<Q as QueryData>::ReadOnly as QueryData>::Item<'a, 'a>> + 'awhere
Q: QueryData,
F: QueryFilter,
fn query_self_and_descendants_wide<'a, Q, F>(
&'a self,
query: &'a Query<'_, '_, Q, F>,
) -> impl Iterator<Item = <<Q as QueryData>::ReadOnly as QueryData>::Item<'a, 'a>> + 'awhere
Q: QueryData,
F: QueryFilter,
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>(
&'a self,
query: &'a Query<'_, '_, Q>,
) -> impl Iterator<Item = <<Q as QueryData>::ReadOnly as QueryData>::Item<'a, 'a>> + 'awhere
Q: QueryData,
fn query_self_and_descendants_deep<'a, Q>(
&'a self,
query: &'a Query<'_, '_, Q>,
) -> impl Iterator<Item = <<Q as QueryData>::ReadOnly as QueryData>::Item<'a, 'a>> + 'awhere
Q: QueryData,
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>(
&self,
objects: &'a Objects<'w, 's, U>,
) -> Option<Object<'w, 's, 'a, U>>where
U: Kind,
fn find_descendant_of_kind_wide<'w, 's, 'a, U>(
&self,
objects: &'a Objects<'w, 's, U>,
) -> Option<Object<'w, 's, 'a, U>>where
U: Kind,
Returns the first descendant of this object (breadth-first order) which matches the given
Kind, if it exists.Source§impl<T> ObjectName for Object<'_, '_, '_, T>where
T: Kind,
impl<T> ObjectName for Object<'_, '_, '_, T>where
T: Kind,
Source§impl<'w, 's, 'a, T> ObjectRebind<T> for Object<'w, 's, 'a, T>where
T: Kind,
impl<'w, 's, 'a, T> ObjectRebind<T> for Object<'w, 's, 'a, T>where
T: Kind,
Source§unsafe fn rebind_as<U>(
&self,
instance: Instance<U>,
) -> <Object<'w, 's, 'a, T> as ObjectRebind<T>>::Rebind<U>where
U: Kind,
unsafe fn rebind_as<U>(
&self,
instance: Instance<U>,
) -> <Object<'w, 's, 'a, T> as ObjectRebind<T>>::Rebind<U>where
U: Kind,
Source§fn cast_into_any(self) -> Self::Rebind<Any>
fn cast_into_any(self) -> Self::Rebind<Any>
Casts this object into an
Object<Any>. Read moreSource§unsafe fn cast_into_unchecked<U>(self) -> Self::Rebind<U>where
U: Kind,
unsafe fn cast_into_unchecked<U>(self) -> Self::Rebind<U>where
U: Kind,
Source§impl<T> ObjectTags for Object<'_, '_, '_, T>where
T: Kind,
impl<T> ObjectTags for Object<'_, '_, '_, T>where
T: Kind,
impl<T> Copy for Object<'_, '_, '_, T>where
T: Kind,
impl<T> Eq for Object<'_, '_, '_, T>where
T: Kind,
Auto Trait Implementations§
impl<'w, 's, 'a, T> Freeze for Object<'w, 's, 'a, T>
impl<'w, 's, 'a, T = Any> !RefUnwindSafe for Object<'w, 's, 'a, T>
impl<'w, 's, 'a, T> Send for Object<'w, 's, 'a, T>
impl<'w, 's, 'a, T> Sync for Object<'w, 's, 'a, T>
impl<'w, 's, 'a, T> Unpin for Object<'w, 's, 'a, T>where
T: Unpin,
impl<'w, 's, 'a, T = Any> !UnwindSafe for Object<'w, 's, 'a, T>
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,
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, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
impl<T, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
Source§impl<T> Identity for Twhere
T: ?Sized,
impl<T> Identity for Twhere
T: ?Sized,
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.
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.