Skip to main content

Allow

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,

§

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
§

unsafe fn filter_fetch( _: &<Allow<T> as WorldQuery>::State, _: &mut <Allow<T> as WorldQuery>::Fetch<'_>, _: Entity, _: TableRow, ) -> bool

Returns true if the provided Entity and [TableRow] should be included in the query results. If false, the entity will be skipped. Read more
§

impl<T> WorldQuery for Allow<T>
where T: Component,

§

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> = ()

Per archetype/table state retrieved by this [WorldQuery] to compute Self::Item for each entity.
§

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,

This function manually implements subtyping for the query fetches.
§

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)

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)

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)

Adds any component accesses to the current entity used by this [WorldQuery] to access. Read more
§

fn init_state(world: &mut World) -> ComponentId

Creates and initializes a State for this [WorldQuery] type.
§

fn get_state(components: &Components) -> Option<<Allow<T> as WorldQuery>::State>

Attempts to initialize a State for this [WorldQuery] type using read-only access to [Components].
§

fn matches_component_set( _: &ComponentId, _: &impl Fn(ComponentId) -> bool, ) -> bool

Returns true if this query matches a set of components. Otherwise, returns false. Read more
§

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<'_>)

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T> IntoResult<T> for T

§

fn into_result(self) -> Result<T, RunSystemError>

Converts this type into the system output type.
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> ConditionalSend for T
where T: Send,