Struct hecs_schedule::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>
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> 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