pub struct SubWorldRaw<A, T> { /* private fields */ }Expand description
Implementations§
Source§impl<A, T> SubWorldRaw<A, T>
impl<A, T> SubWorldRaw<A, T>
Source§impl<A, T: ComponentBorrow> SubWorldRaw<A, T>
impl<A, T: ComponentBorrow> SubWorldRaw<A, T>
Source§impl<'w, A: 'w + Deref<Target = World>, T: ComponentBorrow> SubWorldRaw<A, T>
impl<'w, A: 'w + Deref<Target = World>, T: ComponentBorrow> SubWorldRaw<A, T>
Sourcepub fn query<Q: Query + Subset>(&self) -> QueryBorrow<'_, Q>
pub fn query<Q: Query + Subset>(&self) -> QueryBorrow<'_, Q>
Sourcepub fn query_one<Q: Query + Subset>(
&'w self,
entity: Entity,
) -> Result<QueryOne<'w, Q>>
pub fn query_one<Q: Query + Subset>( &'w self, entity: Entity, ) -> Result<QueryOne<'w, Q>>
Query the subworld for a single entity. Wraps the hecs::NoSuchEntity error and provides the entity id
Sourcepub fn get<C: Component>(&self, entity: Entity) -> Result<Ref<'_, C>>
pub fn get<C: Component>(&self, entity: Entity) -> Result<Ref<'_, C>>
Get a single component from the world.
Wraps the hecs::NoSuchEntity error and provides the entity id
Sourcepub fn get_mut<C: Component>(&self, entity: Entity) -> Result<RefMut<'_, C>>
pub fn get_mut<C: Component>(&self, entity: Entity) -> Result<RefMut<'_, C>>
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: Deref<Target = World>, T: Query> SubWorldRaw<A, T>
impl<A: Deref<Target = World>, T: Query> SubWorldRaw<A, T>
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: ExternalClone, T: ComponentBorrow> SubWorldRaw<A, T>
impl<A: ExternalClone, T: ComponentBorrow> SubWorldRaw<A, T>
Sourcepub fn split<U: ComponentBorrow + Subset>(&self) -> Result<SubWorldRaw<A, U>>
pub fn split<U: ComponentBorrow + Subset>(&self) -> Result<SubWorldRaw<A, U>>
Splits the subworld further into a compatible subworld. Fails if not compatible
Trait Implementations§
Source§impl<A, T: ComponentBorrow + Query> ComponentBorrow for SubWorldRaw<A, T>
impl<A, T: ComponentBorrow + Query> ComponentBorrow for SubWorldRaw<A, T>
Source§impl<A: ExternalClone, T: ComponentBorrow, U: ComponentBorrow + Subset> From<&SubWorldRaw<A, T>> for SubWorldRaw<A, U>
impl<A: ExternalClone, T: ComponentBorrow, U: ComponentBorrow + Subset> From<&SubWorldRaw<A, T>> for SubWorldRaw<A, U>
Source§fn from(value: &SubWorldRaw<A, T>) -> Self
fn from(value: &SubWorldRaw<A, T>) -> Self
Converts to this type from the input type.
Source§impl<'a, 'b, T: ComponentBorrow, U: ComponentBorrow + Subset> From<&'b SubWorldRaw<AtomicRef<'a, World>, T>> for SubWorldRef<'b, U>
impl<'a, 'b, T: ComponentBorrow, U: ComponentBorrow + Subset> From<&'b SubWorldRaw<AtomicRef<'a, World>, T>> for SubWorldRef<'b, U>
Source§impl<A, T> From<A> for SubWorldRaw<A, T>
impl<A, T> From<A> for SubWorldRaw<A, T>
Source§impl<A: Deref<Target = World>, T: ComponentBorrow> GenericWorld for SubWorldRaw<A, T>
impl<A: Deref<Target = World>, T: ComponentBorrow> GenericWorld for SubWorldRaw<A, T>
Source§fn to_ref<U: ComponentBorrow + Subset>(&self) -> SubWorldRef<'_, U>
fn to_ref<U: ComponentBorrow + Subset>(&self) -> SubWorldRef<'_, U>
Convert the subworld into another holding an internal reference to the original world.
Source§fn try_query_one<Q: Query + Subset>(
&self,
entity: Entity,
) -> Result<QueryOne<'_, Q>>
fn try_query_one<Q: Query + Subset>( &self, entity: Entity, ) -> Result<QueryOne<'_, Q>>
Queries the world for a specific entity
Source§fn try_get<C: Component>(&self, entity: Entity) -> Result<Ref<'_, C>>
fn try_get<C: Component>(&self, entity: Entity) -> Result<Ref<'_, C>>
Get a single component for an entity
Returns the contextual result since hecs-schedule is required to be imported
anyway
Source§fn try_get_mut<C: Component>(&self, entity: Entity) -> Result<RefMut<'_, C>>
fn try_get_mut<C: Component>(&self, entity: Entity) -> Result<RefMut<'_, C>>
Get a single component for an entity
Returns the contextual result since hecs-schedule is required to be imported
anyway
Source§fn to_empty(&self) -> EmptyWorld<'_>
fn to_empty(&self) -> EmptyWorld<'_>
Transform this into a subworld which borrows no components.
This is useful for concurrent access of entities.
Auto Trait Implementations§
impl<A, T> Freeze for SubWorldRaw<A, T>where
A: Freeze,
impl<A, T> RefUnwindSafe for SubWorldRaw<A, T>where
A: RefUnwindSafe,
T: RefUnwindSafe,
impl<A, T> Send for SubWorldRaw<A, T>
impl<A, T> Sync for SubWorldRaw<A, T>
impl<A, T> Unpin for SubWorldRaw<A, T>
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
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 more