Struct Allow
pub struct Allow<T>(/* private fields */);Expand description
Allows a query to contain entities with the component T, bypassing DefaultQueryFilters.
Trait Implementations§
§impl<T> QueryFilter for Allow<T>where
T: Component,
impl<T> QueryFilter for Allow<T>where
T: Component,
§const IS_ARCHETYPAL: bool = true
const IS_ARCHETYPAL: bool = true
Returns true if (and only if) this Filter relies strictly on archetypes to limit which
components are accessed by the Query. Read more
§impl<T> WorldQuery for Allow<T>where
T: Component,
impl<T> WorldQuery for Allow<T>where
T: Component,
§const IS_DENSE: bool = true
const IS_DENSE: bool = true
Returns true if (and only if) every table of every archetype matched by this fetch contains
all of the matched components. Read more
§type Fetch<'w> = ()
type Fetch<'w> = ()
Per archetype/table state retrieved by this [
WorldQuery] to compute Self::Item for each entity.§type State = ComponentId
type State = ComponentId
State used to construct a
Self::Fetch. This will be cached inside QueryState,
so it is best to move as much data / computation here as possible to reduce the cost of
constructing Self::Fetch.§fn shrink_fetch<'wlong, 'wshort>(
_: <Allow<T> as WorldQuery>::Fetch<'wlong>,
) -> <Allow<T> as WorldQuery>::Fetch<'wshort>where
'wlong: 'wshort,
fn shrink_fetch<'wlong, 'wshort>(
_: <Allow<T> as WorldQuery>::Fetch<'wlong>,
) -> <Allow<T> as WorldQuery>::Fetch<'wshort>where
'wlong: 'wshort,
This function manually implements subtyping for the query fetches.
§unsafe fn init_fetch(_: UnsafeWorldCell<'_>, _: &ComponentId, _: Tick, _: Tick)
unsafe fn init_fetch(_: UnsafeWorldCell<'_>, _: &ComponentId, _: Tick, _: Tick)
Creates a new instance of
Self::Fetch,
by combining data from the World with the cached Self::State.
Readonly accesses resources registered in [WorldQuery::update_component_access]. Read more§unsafe fn set_archetype(_: &mut (), _: &ComponentId, _: &Archetype, _: &Table)
unsafe fn set_archetype(_: &mut (), _: &ComponentId, _: &Archetype, _: &Table)
Adjusts internal state to account for the next [
Archetype]. This will always be called on
archetypes that match this [WorldQuery]. Read more§unsafe fn set_table(_: &mut (), _: &ComponentId, _: &Table)
unsafe fn set_table(_: &mut (), _: &ComponentId, _: &Table)
Adjusts internal state to account for the next [
Table]. This will always be called on tables
that match this [WorldQuery]. Read more§fn update_component_access(_: &ComponentId, access: &mut FilteredAccess)
fn update_component_access(_: &ComponentId, access: &mut FilteredAccess)
§fn init_state(world: &mut World) -> ComponentId
fn init_state(world: &mut World) -> ComponentId
Creates and initializes a
State for this [WorldQuery] type.§fn matches_component_set(
_: &ComponentId,
_: &impl Fn(ComponentId) -> bool,
) -> bool
fn matches_component_set( _: &ComponentId, _: &impl Fn(ComponentId) -> bool, ) -> bool
§fn init_nested_access(
_state: &Self::State,
_system_name: Option<&str>,
_component_access_set: &mut FilteredAccessSet,
_world: UnsafeWorldCell<'_>,
)
fn init_nested_access( _state: &Self::State, _system_name: Option<&str>, _component_access_set: &mut FilteredAccessSet, _world: UnsafeWorldCell<'_>, )
Adds any component accesses to other entities used by this [
WorldQuery]. Read more§fn update_archetypes(_state: &mut Self::State, _world: UnsafeWorldCell<'_>)
fn update_archetypes(_state: &mut Self::State, _world: UnsafeWorldCell<'_>)
Called when the query state is updating its archetype cache.
This can be used by nested queries to update their internal archetype caches.
Auto Trait Implementations§
impl<T> Freeze for Allow<T>
impl<T> RefUnwindSafe for Allow<T>where
T: RefUnwindSafe,
impl<T> Send for Allow<T>where
T: Send,
impl<T> Sync for Allow<T>where
T: Sync,
impl<T> Unpin for Allow<T>where
T: Unpin,
impl<T> UnsafeUnpin for Allow<T>
impl<T> UnwindSafe for Allow<T>where
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> IntoResult<T> for T
impl<T> IntoResult<T> for T
§fn into_result(self) -> Result<T, RunSystemError>
fn into_result(self) -> Result<T, RunSystemError>
Converts this type into the system output type.