Struct despero::ecs::SubWorldRaw
source · pub struct SubWorldRaw<A, T> { /* private fields */ }
Expand description
Implementations§
source§impl<A, T> SubWorldRaw<A, T>
impl<A, T> SubWorldRaw<A, T>
sourcepub fn new(world: A) -> SubWorldRaw<A, T>
pub fn new(world: A) -> SubWorldRaw<A, T>
Splits the world into a subworld. No borrow checking is performed so may fail during query unless guarded otherwise.
source§impl<A, T> SubWorldRaw<A, T>where
T: ComponentBorrow,
impl<A, T> SubWorldRaw<A, T>where T: ComponentBorrow,
source§impl<'w, A, T> SubWorldRaw<A, T>where
A: 'w + Deref<Target = World>,
T: ComponentBorrow,
impl<'w, A, T> SubWorldRaw<A, T>where A: 'w + Deref<Target = World>, T: ComponentBorrow,
sourcepub fn query<Q>(&self) -> QueryBorrow<'_, Q>where
Q: Query + Subset,
pub fn query<Q>(&self) -> QueryBorrow<'_, Q>where Q: Query + Subset,
sourcepub fn query_one<Q>(&'w self, entity: Entity) -> Result<QueryOne<'w, Q>, Error>where
Q: Query + Subset,
pub fn query_one<Q>(&'w self, entity: Entity) -> Result<QueryOne<'w, Q>, Error>where Q: Query + Subset,
Query the subworld for a single entity. Wraps the hecs::NoSuchEntity error and provides the entity id
sourcepub fn get<C>(&self, entity: Entity) -> Result<Ref<'_, C>, Error>where
C: Component,
pub fn get<C>(&self, entity: Entity) -> Result<Ref<'_, C>, Error>where C: Component,
Get a single component from the world.
Wraps the hecs::NoSuchEntity error and provides the entity id
sourcepub fn get_mut<C>(&self, entity: Entity) -> Result<RefMut<'_, C>, Error>where
C: Component,
pub fn get_mut<C>(&self, entity: Entity) -> Result<RefMut<'_, C>, Error>where C: Component,
Get a single component from the world.
Wraps the hecs::NoSuchEntity error and provides the entity id
sourcepub fn reserve_entities(&self, count: u32) -> impl Iterator<Item = Entity>
pub fn reserve_entities(&self, count: u32) -> impl Iterator<Item = Entity>
Reserve multiple entities concurrently
source§impl<A, T> SubWorldRaw<A, T>where
A: Deref<Target = World>,
T: Query,
impl<A, T> SubWorldRaw<A, T>where A: Deref<Target = World>, T: Query,
sourcepub fn native_query(&self) -> QueryBorrow<'_, T>
pub fn native_query(&self) -> QueryBorrow<'_, T>
Query the full access of the subworld. Does not fail as access is guaranteed
source§impl<A, T> SubWorldRaw<A, T>where
A: ExternalClone,
T: ComponentBorrow,
impl<A, T> SubWorldRaw<A, T>where A: ExternalClone, T: ComponentBorrow,
sourcepub fn split<U>(&self) -> Result<SubWorldRaw<A, U>, Error>where
U: ComponentBorrow + Subset,
pub fn split<U>(&self) -> Result<SubWorldRaw<A, U>, Error>where U: ComponentBorrow + Subset,
Splits the subworld further into a compatible subworld. Fails if not compatible
Trait Implementations§
source§impl<A, T> ComponentBorrow for SubWorldRaw<A, T>where
T: ComponentBorrow + Query,
impl<A, T> ComponentBorrow for SubWorldRaw<A, T>where T: ComponentBorrow + Query,
source§impl<'a, T> ContextBorrow<'a> for SubWorldRaw<AtomicRef<'a, World>, T>
impl<'a, T> ContextBorrow<'a> for SubWorldRaw<AtomicRef<'a, World>, T>
source§impl<'a, 'b, T, U> From<&'b SubWorldRaw<AtomicRef<'a, World>, T>> for SubWorldRaw<&'b World, U>where
T: ComponentBorrow,
U: ComponentBorrow + Subset,
impl<'a, 'b, T, U> From<&'b SubWorldRaw<AtomicRef<'a, World>, T>> for SubWorldRaw<&'b World, U>where T: ComponentBorrow, U: ComponentBorrow + Subset,
source§fn from(
subworld: &'b SubWorldRaw<AtomicRef<'a, World>, T>
) -> SubWorldRaw<&'b World, U>
fn from( subworld: &'b SubWorldRaw<AtomicRef<'a, World>, T> ) -> SubWorldRaw<&'b World, U>
Converts to this type from the input type.
source§impl<A, T, U> From<&SubWorldRaw<A, T>> for SubWorldRaw<A, U>where
A: ExternalClone,
T: ComponentBorrow,
U: ComponentBorrow + Subset,
impl<A, T, U> From<&SubWorldRaw<A, T>> for SubWorldRaw<A, U>where A: ExternalClone, T: ComponentBorrow, U: ComponentBorrow + Subset,
source§fn from(value: &SubWorldRaw<A, T>) -> SubWorldRaw<A, U>
fn from(value: &SubWorldRaw<A, T>) -> SubWorldRaw<A, U>
Converts to this type from the input type.
source§impl<A, T> From<A> for SubWorldRaw<A, T>
impl<A, T> From<A> for SubWorldRaw<A, T>
source§fn from(world: A) -> SubWorldRaw<A, T>
fn from(world: A) -> SubWorldRaw<A, T>
Converts to this type from the input type.
source§impl<A, T> GenericWorld for SubWorldRaw<A, T>where
A: Deref<Target = World>,
T: ComponentBorrow,
impl<A, T> GenericWorld for SubWorldRaw<A, T>where A: Deref<Target = World>, T: ComponentBorrow,
source§fn to_ref<U>(&self) -> SubWorldRaw<&World, U>where
U: ComponentBorrow + Subset,
fn to_ref<U>(&self) -> SubWorldRaw<&World, U>where U: ComponentBorrow + Subset,
Convert the subworld into another holding an internal reference to the original world.
source§fn try_query<Q>(&self) -> Result<QueryBorrow<'_, Q>, Error>where
Q: Query + Subset,
fn try_query<Q>(&self) -> Result<QueryBorrow<'_, Q>, Error>where Q: Query + Subset,
Queries the world
source§fn try_query_one<Q>(&self, entity: Entity) -> Result<QueryOne<'_, Q>, Error>where
Q: Query + Subset,
fn try_query_one<Q>(&self, entity: Entity) -> Result<QueryOne<'_, Q>, Error>where Q: Query + Subset,
Queries the world for a specific entity
source§fn try_get<C>(&self, entity: Entity) -> Result<Ref<'_, C>, Error>where
C: Component,
fn try_get<C>(&self, entity: Entity) -> Result<Ref<'_, C>, Error>where C: Component,
Get a single component for an entity
Returns the contextual result since hecs-schedule is required to be imported
anyway
source§impl<T> IntoBorrow for SubWorldRaw<AtomicRef<'_, World>, T>where
T: Component,
impl<T> IntoBorrow for SubWorldRaw<AtomicRef<'_, World>, T>where T: Component,
source§impl<'a, A, T> View<'a> for SubWorldRaw<A, T>where
A: Deref<Target = World>,
T: ComponentBorrow,
impl<'a, A, T> View<'a> for SubWorldRaw<A, T>where A: Deref<Target = World>, T: ComponentBorrow,
source§fn split(world: <SubWorldRaw<A, T> as View<'a>>::Superset) -> SubWorldRaw<A, T>
fn split(world: <SubWorldRaw<A, T> as View<'a>>::Superset) -> SubWorldRaw<A, T>
Splits from the containing superset
Auto Trait Implementations§
impl<A, T> RefUnwindSafe for SubWorldRaw<A, T>where A: RefUnwindSafe, T: RefUnwindSafe,
impl<A, T> Send for SubWorldRaw<A, T>where A: Send, T: Send,
impl<A, T> Sync for SubWorldRaw<A, T>where A: Sync, T: Sync,
impl<A, T> Unpin for SubWorldRaw<A, T>where A: Unpin, T: Unpin,
impl<A, T> UnwindSafe for SubWorldRaw<A, T>where A: UnwindSafe, T: UnwindSafe,
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<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere T: Any,
§fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
Convert
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
Convert
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
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)
Convert
&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)
Convert
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.§impl<T> FromFd for Twhere
T: From<OwnedFd>,
impl<T> FromFd for Twhere T: From<OwnedFd>,
§impl<T> FromFilelike for Twhere
T: From<OwnedFd>,
impl<T> FromFilelike for Twhere T: From<OwnedFd>,
§fn from_filelike(owned: OwnedFd) -> T
fn from_filelike(owned: OwnedFd) -> T
Constructs a new instance of
Self
from the given filelike object. Read more§fn from_into_filelike<Owned>(owned: Owned) -> Twhere
Owned: IntoFilelike,
fn from_into_filelike<Owned>(owned: Owned) -> Twhere Owned: IntoFilelike,
Constructs a new instance of
Self
from the given filelike object
converted from into_owned
. Read more§impl<T> FromSocketlike for Twhere
T: From<OwnedFd>,
impl<T> FromSocketlike for Twhere T: From<OwnedFd>,
§fn from_socketlike(owned: OwnedFd) -> T
fn from_socketlike(owned: OwnedFd) -> T
Constructs a new instance of
Self
from the given socketlike object.§fn from_into_socketlike<Owned>(owned: Owned) -> Twhere
Owned: IntoSocketlike,
fn from_into_socketlike<Owned>(owned: Owned) -> Twhere Owned: IntoSocketlike,
Constructs a new instance of
Self
from the given socketlike object
converted from into_owned
.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>
§impl<T> Pointable for T
impl<T> Pointable for T
§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere SS: SubsetOf<SP>,
§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self
from the equivalent element of its
superset. Read more§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self
is actually part of its subset T
(and can be converted to it).§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset
but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self
to the equivalent element of its superset.