Struct bevy::prelude::QueryState
[−]pub struct QueryState<Q, F = ()> where
Q: WorldQuery,
F: WorldQuery,
<F as WorldQuery>::Fetch: FilterFetch, { /* private fields */ }
Expand description
Provides scoped access to a World
state according to a given WorldQuery
and query filter.
Implementations
impl<Q, F> QueryState<Q, F> where
Q: WorldQuery,
F: WorldQuery,
<F as WorldQuery>::Fetch: FilterFetch,
impl<Q, F> QueryState<Q, F> where
Q: WorldQuery,
F: WorldQuery,
<F as WorldQuery>::Fetch: FilterFetch,
pub fn new(world: &mut World) -> QueryState<Q, F>
pub fn new(world: &mut World) -> QueryState<Q, F>
Creates a new QueryState
from a given World
and inherits the result of world.id()
.
pub fn is_empty(
&self,
world: &World,
last_change_tick: u32,
change_tick: u32
) -> bool
pub fn is_empty(
&self,
world: &World,
last_change_tick: u32,
change_tick: u32
) -> bool
Checks if the query is empty for the given World
, where the last change and current tick are given.
pub fn update_archetypes(&mut self, world: &World)
pub fn update_archetypes(&mut self, world: &World)
Takes a query for the given World
, checks if the given world is the same as the query, and
generates new archetypes for the given world.
Panics
Panics if the world.id()
does not equal the current QueryState
internal id.
pub fn validate_world(&self, world: &World)
pub fn new_archetype(&mut self, archetype: &Archetype)
pub fn new_archetype(&mut self, archetype: &Archetype)
Creates a new Archetype
.
pub fn get(
&'s mut self,
world: &'w World,
entity: Entity
) -> Result<<<Q as WorldQuery>::ReadOnlyFetch as Fetch<'w, 's>>::Item, QueryEntityError>
pub fn get(
&'s mut self,
world: &'w World,
entity: Entity
) -> Result<<<Q as WorldQuery>::ReadOnlyFetch as Fetch<'w, 's>>::Item, QueryEntityError>
Gets the query result for the given World
and Entity
.
This can only be called for read-only queries, see Self::get_mut
for write-queries.
pub fn get_mut(
&'s mut self,
world: &'w mut World,
entity: Entity
) -> Result<<<Q as WorldQuery>::Fetch as Fetch<'w, 's>>::Item, QueryEntityError>
pub fn get_mut(
&'s mut self,
world: &'w mut World,
entity: Entity
) -> Result<<<Q as WorldQuery>::Fetch as Fetch<'w, 's>>::Item, QueryEntityError>
pub fn get_manual(
&'s self,
world: &'w World,
entity: Entity
) -> Result<<<Q as WorldQuery>::ReadOnlyFetch as Fetch<'w, 's>>::Item, QueryEntityError>
pub unsafe fn get_unchecked(
&'s mut self,
world: &'w World,
entity: Entity
) -> Result<<<Q as WorldQuery>::Fetch as Fetch<'w, 's>>::Item, QueryEntityError>
pub unsafe fn get_unchecked(
&'s mut self,
world: &'w World,
entity: Entity
) -> Result<<<Q as WorldQuery>::Fetch as Fetch<'w, 's>>::Item, QueryEntityError>
pub fn iter(
&'s mut self,
world: &'w World
) -> QueryIter<'w, 's, Q, <Q as WorldQuery>::ReadOnlyFetch, F>ⓘNotable traits for QueryIter<'w, 's, Q, QF, F>impl<'w, 's, Q, QF, F> Iterator for QueryIter<'w, 's, Q, QF, F> where
Q: WorldQuery,
F: WorldQuery,
QF: Fetch<'w, 's, State = <Q as WorldQuery>::State>,
<F as WorldQuery>::Fetch: FilterFetch, type Item = <QF as Fetch<'w, 's>>::Item;
pub fn iter(
&'s mut self,
world: &'w World
) -> QueryIter<'w, 's, Q, <Q as WorldQuery>::ReadOnlyFetch, F>ⓘNotable traits for QueryIter<'w, 's, Q, QF, F>impl<'w, 's, Q, QF, F> Iterator for QueryIter<'w, 's, Q, QF, F> where
Q: WorldQuery,
F: WorldQuery,
QF: Fetch<'w, 's, State = <Q as WorldQuery>::State>,
<F as WorldQuery>::Fetch: FilterFetch, type Item = <QF as Fetch<'w, 's>>::Item;
Q: WorldQuery,
F: WorldQuery,
QF: Fetch<'w, 's, State = <Q as WorldQuery>::State>,
<F as WorldQuery>::Fetch: FilterFetch, type Item = <QF as Fetch<'w, 's>>::Item;
Returns an Iterator
over the query results for the given World
.
This can only be called for read-only queries, see Self::iter_mut
for write-queries.
pub fn iter_mut(
&'s mut self,
world: &'w mut World
) -> QueryIter<'w, 's, Q, <Q as WorldQuery>::Fetch, F>ⓘNotable traits for QueryIter<'w, 's, Q, QF, F>impl<'w, 's, Q, QF, F> Iterator for QueryIter<'w, 's, Q, QF, F> where
Q: WorldQuery,
F: WorldQuery,
QF: Fetch<'w, 's, State = <Q as WorldQuery>::State>,
<F as WorldQuery>::Fetch: FilterFetch, type Item = <QF as Fetch<'w, 's>>::Item;
pub fn iter_mut(
&'s mut self,
world: &'w mut World
) -> QueryIter<'w, 's, Q, <Q as WorldQuery>::Fetch, F>ⓘNotable traits for QueryIter<'w, 's, Q, QF, F>impl<'w, 's, Q, QF, F> Iterator for QueryIter<'w, 's, Q, QF, F> where
Q: WorldQuery,
F: WorldQuery,
QF: Fetch<'w, 's, State = <Q as WorldQuery>::State>,
<F as WorldQuery>::Fetch: FilterFetch, type Item = <QF as Fetch<'w, 's>>::Item;
Q: WorldQuery,
F: WorldQuery,
QF: Fetch<'w, 's, State = <Q as WorldQuery>::State>,
<F as WorldQuery>::Fetch: FilterFetch, type Item = <QF as Fetch<'w, 's>>::Item;
pub fn iter_manual(
&'s self,
world: &'w World
) -> QueryIter<'w, 's, Q, <Q as WorldQuery>::ReadOnlyFetch, F>ⓘNotable traits for QueryIter<'w, 's, Q, QF, F>impl<'w, 's, Q, QF, F> Iterator for QueryIter<'w, 's, Q, QF, F> where
Q: WorldQuery,
F: WorldQuery,
QF: Fetch<'w, 's, State = <Q as WorldQuery>::State>,
<F as WorldQuery>::Fetch: FilterFetch, type Item = <QF as Fetch<'w, 's>>::Item;
pub fn iter_manual(
&'s self,
world: &'w World
) -> QueryIter<'w, 's, Q, <Q as WorldQuery>::ReadOnlyFetch, F>ⓘNotable traits for QueryIter<'w, 's, Q, QF, F>impl<'w, 's, Q, QF, F> Iterator for QueryIter<'w, 's, Q, QF, F> where
Q: WorldQuery,
F: WorldQuery,
QF: Fetch<'w, 's, State = <Q as WorldQuery>::State>,
<F as WorldQuery>::Fetch: FilterFetch, type Item = <QF as Fetch<'w, 's>>::Item;
Q: WorldQuery,
F: WorldQuery,
QF: Fetch<'w, 's, State = <Q as WorldQuery>::State>,
<F as WorldQuery>::Fetch: FilterFetch, type Item = <QF as Fetch<'w, 's>>::Item;
Returns an Iterator
over all possible combinations of K
query results without repetition.
This can only be called for read-only queries.
For permutations of size K of query returning N results, you will get:
- if K == N: one permutation of all query results
- if K < N: all possible K-sized combinations of query results, without repetition
- if K > N: empty set (no K-sized combinations exist)
This can only be called for read-only queries, see Self::iter_combinations_mut
for
write-queries.
pub fn iter_combinations<const K: usize>(
&'s mut self,
world: &'w World
) -> QueryCombinationIter<'w, 's, Q, <Q as WorldQuery>::ReadOnlyFetch, F, K>ⓘNotable traits for QueryCombinationIter<'w, 's, Q, QF, F, K>impl<'w, 's, Q, QF, F, const K: usize> Iterator for QueryCombinationIter<'w, 's, Q, QF, F, K> where
Q: WorldQuery,
F: WorldQuery,
QF: Fetch<'w, 's, State = <Q as WorldQuery>::State> + Clone + ReadOnlyFetch,
<F as WorldQuery>::Fetch: Clone,
<F as WorldQuery>::Fetch: FilterFetch,
<F as WorldQuery>::Fetch: ReadOnlyFetch, type Item = [<QF as Fetch<'w, 's>>::Item; K];
pub fn iter_combinations<const K: usize>(
&'s mut self,
world: &'w World
) -> QueryCombinationIter<'w, 's, Q, <Q as WorldQuery>::ReadOnlyFetch, F, K>ⓘNotable traits for QueryCombinationIter<'w, 's, Q, QF, F, K>impl<'w, 's, Q, QF, F, const K: usize> Iterator for QueryCombinationIter<'w, 's, Q, QF, F, K> where
Q: WorldQuery,
F: WorldQuery,
QF: Fetch<'w, 's, State = <Q as WorldQuery>::State> + Clone + ReadOnlyFetch,
<F as WorldQuery>::Fetch: Clone,
<F as WorldQuery>::Fetch: FilterFetch,
<F as WorldQuery>::Fetch: ReadOnlyFetch, type Item = [<QF as Fetch<'w, 's>>::Item; K];
Q: WorldQuery,
F: WorldQuery,
QF: Fetch<'w, 's, State = <Q as WorldQuery>::State> + Clone + ReadOnlyFetch,
<F as WorldQuery>::Fetch: Clone,
<F as WorldQuery>::Fetch: FilterFetch,
<F as WorldQuery>::Fetch: ReadOnlyFetch, type Item = [<QF as Fetch<'w, 's>>::Item; K];
Returns an Iterator
over all possible combinations of K
query results without repetition.
This can only be called for read-only queries.
For permutations of size K of query returning N results, you will get:
- if K == N: one permutation of all query results
- if K < N: all possible K-sized combinations of query results, without repetition
- if K > N: empty set (no K-sized combinations exist)
This can only be called for read-only queries, see Self::iter_combinations_mut
for
write-queries.
pub fn iter_combinations_mut<const K: usize>(
&'s mut self,
world: &'w mut World
) -> QueryCombinationIter<'w, 's, Q, <Q as WorldQuery>::Fetch, F, K>ⓘNotable traits for QueryCombinationIter<'w, 's, Q, QF, F, K>impl<'w, 's, Q, QF, F, const K: usize> Iterator for QueryCombinationIter<'w, 's, Q, QF, F, K> where
Q: WorldQuery,
F: WorldQuery,
QF: Fetch<'w, 's, State = <Q as WorldQuery>::State> + Clone + ReadOnlyFetch,
<F as WorldQuery>::Fetch: Clone,
<F as WorldQuery>::Fetch: FilterFetch,
<F as WorldQuery>::Fetch: ReadOnlyFetch, type Item = [<QF as Fetch<'w, 's>>::Item; K];
pub fn iter_combinations_mut<const K: usize>(
&'s mut self,
world: &'w mut World
) -> QueryCombinationIter<'w, 's, Q, <Q as WorldQuery>::Fetch, F, K>ⓘNotable traits for QueryCombinationIter<'w, 's, Q, QF, F, K>impl<'w, 's, Q, QF, F, const K: usize> Iterator for QueryCombinationIter<'w, 's, Q, QF, F, K> where
Q: WorldQuery,
F: WorldQuery,
QF: Fetch<'w, 's, State = <Q as WorldQuery>::State> + Clone + ReadOnlyFetch,
<F as WorldQuery>::Fetch: Clone,
<F as WorldQuery>::Fetch: FilterFetch,
<F as WorldQuery>::Fetch: ReadOnlyFetch, type Item = [<QF as Fetch<'w, 's>>::Item; K];
Q: WorldQuery,
F: WorldQuery,
QF: Fetch<'w, 's, State = <Q as WorldQuery>::State> + Clone + ReadOnlyFetch,
<F as WorldQuery>::Fetch: Clone,
<F as WorldQuery>::Fetch: FilterFetch,
<F as WorldQuery>::Fetch: ReadOnlyFetch, type Item = [<QF as Fetch<'w, 's>>::Item; K];
Iterates over all possible combinations of K
query results for the given World
without repetition.
For permutations of size K of query returning N results, you will get:
- if K == N: one permutation of all query results
- if K < N: all possible K-sized combinations of query results, without repetition
- if K > N: empty set (no K-sized combinations exist)
pub unsafe fn iter_unchecked(
&'s mut self,
world: &'w World
) -> QueryIter<'w, 's, Q, <Q as WorldQuery>::Fetch, F>ⓘNotable traits for QueryIter<'w, 's, Q, QF, F>impl<'w, 's, Q, QF, F> Iterator for QueryIter<'w, 's, Q, QF, F> where
Q: WorldQuery,
F: WorldQuery,
QF: Fetch<'w, 's, State = <Q as WorldQuery>::State>,
<F as WorldQuery>::Fetch: FilterFetch, type Item = <QF as Fetch<'w, 's>>::Item;
pub unsafe fn iter_unchecked(
&'s mut self,
world: &'w World
) -> QueryIter<'w, 's, Q, <Q as WorldQuery>::Fetch, F>ⓘNotable traits for QueryIter<'w, 's, Q, QF, F>impl<'w, 's, Q, QF, F> Iterator for QueryIter<'w, 's, Q, QF, F> where
Q: WorldQuery,
F: WorldQuery,
QF: Fetch<'w, 's, State = <Q as WorldQuery>::State>,
<F as WorldQuery>::Fetch: FilterFetch, type Item = <QF as Fetch<'w, 's>>::Item;
Q: WorldQuery,
F: WorldQuery,
QF: Fetch<'w, 's, State = <Q as WorldQuery>::State>,
<F as WorldQuery>::Fetch: FilterFetch, type Item = <QF as Fetch<'w, 's>>::Item;
pub unsafe fn iter_combinations_unchecked<const K: usize>(
&'s mut self,
world: &'w World
) -> QueryCombinationIter<'w, 's, Q, <Q as WorldQuery>::Fetch, F, K>ⓘNotable traits for QueryCombinationIter<'w, 's, Q, QF, F, K>impl<'w, 's, Q, QF, F, const K: usize> Iterator for QueryCombinationIter<'w, 's, Q, QF, F, K> where
Q: WorldQuery,
F: WorldQuery,
QF: Fetch<'w, 's, State = <Q as WorldQuery>::State> + Clone + ReadOnlyFetch,
<F as WorldQuery>::Fetch: Clone,
<F as WorldQuery>::Fetch: FilterFetch,
<F as WorldQuery>::Fetch: ReadOnlyFetch, type Item = [<QF as Fetch<'w, 's>>::Item; K];
pub unsafe fn iter_combinations_unchecked<const K: usize>(
&'s mut self,
world: &'w World
) -> QueryCombinationIter<'w, 's, Q, <Q as WorldQuery>::Fetch, F, K>ⓘNotable traits for QueryCombinationIter<'w, 's, Q, QF, F, K>impl<'w, 's, Q, QF, F, const K: usize> Iterator for QueryCombinationIter<'w, 's, Q, QF, F, K> where
Q: WorldQuery,
F: WorldQuery,
QF: Fetch<'w, 's, State = <Q as WorldQuery>::State> + Clone + ReadOnlyFetch,
<F as WorldQuery>::Fetch: Clone,
<F as WorldQuery>::Fetch: FilterFetch,
<F as WorldQuery>::Fetch: ReadOnlyFetch, type Item = [<QF as Fetch<'w, 's>>::Item; K];
Q: WorldQuery,
F: WorldQuery,
QF: Fetch<'w, 's, State = <Q as WorldQuery>::State> + Clone + ReadOnlyFetch,
<F as WorldQuery>::Fetch: Clone,
<F as WorldQuery>::Fetch: FilterFetch,
<F as WorldQuery>::Fetch: ReadOnlyFetch, type Item = [<QF as Fetch<'w, 's>>::Item; K];
Returns an Iterator
over all possible combinations of K
query results for the
given World
without repetition.
This can only be called for read-only queries.
Safety
This does not check for mutable query correctness. To be safe, make sure mutable queries have unique access to the components they query.
pub fn for_each<'w, 's, FN>(&'s mut self, world: &'w World, func: FN) where
FN: FnMut(<<Q as WorldQuery>::ReadOnlyFetch as Fetch<'w, 's>>::Item),
pub fn for_each<'w, 's, FN>(&'s mut self, world: &'w World, func: FN) where
FN: FnMut(<<Q as WorldQuery>::ReadOnlyFetch as Fetch<'w, 's>>::Item),
Runs func
on each query result for the given World
. This is faster than the equivalent
iter() method, but cannot be chained like a normal Iterator
.
This can only be called for read-only queries, see Self::for_each_mut
for write-queries.
pub fn for_each_mut<'w, 's, FN>(&'s mut self, world: &'w mut World, func: FN) where
FN: FnMut(<<Q as WorldQuery>::Fetch as Fetch<'w, 's>>::Item),
pub fn for_each_mut<'w, 's, FN>(&'s mut self, world: &'w mut World, func: FN) where
FN: FnMut(<<Q as WorldQuery>::Fetch as Fetch<'w, 's>>::Item),
pub unsafe fn for_each_unchecked<'w, 's, FN>(
&'s mut self,
world: &'w World,
func: FN
) where
FN: FnMut(<<Q as WorldQuery>::Fetch as Fetch<'w, 's>>::Item),
pub unsafe fn for_each_unchecked<'w, 's, FN>(
&'s mut self,
world: &'w World,
func: FN
) where
FN: FnMut(<<Q as WorldQuery>::Fetch as Fetch<'w, 's>>::Item),
Runs func
on each query result for the given World
. This is faster than the equivalent
iter() method, but cannot be chained like a normal Iterator
.
This can only be called for read-only queries.
Safety
This does not check for mutable query correctness. To be safe, make sure mutable queries have unique access to the components they query.
pub fn par_for_each<'w, 's, FN>(
&'s mut self,
world: &'w World,
task_pool: &TaskPool,
batch_size: usize,
func: FN
) where
FN: Fn(<<Q as WorldQuery>::ReadOnlyFetch as Fetch<'w, 's>>::Item) + Send + Sync + Clone,
pub fn par_for_each<'w, 's, FN>(
&'s mut self,
world: &'w World,
task_pool: &TaskPool,
batch_size: usize,
func: FN
) where
FN: Fn(<<Q as WorldQuery>::ReadOnlyFetch as Fetch<'w, 's>>::Item) + Send + Sync + Clone,
Runs func
on each query result in parallel using the given task_pool
.
This can only be called for read-only queries, see Self::par_for_each_mut
for
write-queries.
pub fn par_for_each_mut<'w, 's, FN>(
&'s mut self,
world: &'w mut World,
task_pool: &TaskPool,
batch_size: usize,
func: FN
) where
FN: Fn(<<Q as WorldQuery>::Fetch as Fetch<'w, 's>>::Item) + Send + Sync + Clone,
pub fn par_for_each_mut<'w, 's, FN>(
&'s mut self,
world: &'w mut World,
task_pool: &TaskPool,
batch_size: usize,
func: FN
) where
FN: Fn(<<Q as WorldQuery>::Fetch as Fetch<'w, 's>>::Item) + Send + Sync + Clone,
Runs func
on each query result in parallel using the given task_pool
.
pub unsafe fn par_for_each_unchecked<'w, 's, FN>(
&'s mut self,
world: &'w World,
task_pool: &TaskPool,
batch_size: usize,
func: FN
) where
FN: Fn(<<Q as WorldQuery>::Fetch as Fetch<'w, 's>>::Item) + Send + Sync + Clone,
pub unsafe fn par_for_each_unchecked<'w, 's, FN>(
&'s mut self,
world: &'w World,
task_pool: &TaskPool,
batch_size: usize,
func: FN
) where
FN: Fn(<<Q as WorldQuery>::Fetch as Fetch<'w, 's>>::Item) + Send + Sync + Clone,
Runs func
on each query result in parallel using the given task_pool
.
This can only be called for read-only queries.
Safety
This does not check for mutable query correctness. To be safe, make sure mutable queries have unique access to the components they query.
Trait Implementations
impl<'w, 's, Q, F> SystemParamFetch<'w, 's> for QueryState<Q, F> where
Q: 'static + WorldQuery,
F: 'static + WorldQuery,
<F as WorldQuery>::Fetch: FilterFetch,
impl<'w, 's, Q, F> SystemParamFetch<'w, 's> for QueryState<Q, F> where
Q: 'static + WorldQuery,
F: 'static + WorldQuery,
<F as WorldQuery>::Fetch: FilterFetch,
type Item = Query<'w, 's, Q, F>
pub unsafe fn get_param(
state: &'s mut QueryState<Q, F>,
system_meta: &SystemMeta,
world: &'w World,
change_tick: u32
) -> <QueryState<Q, F> as SystemParamFetch<'w, 's>>::Item
pub unsafe fn get_param(
state: &'s mut QueryState<Q, F>,
system_meta: &SystemMeta,
world: &'w World,
change_tick: u32
) -> <QueryState<Q, F> as SystemParamFetch<'w, 's>>::Item
Safety Read more
impl<Q, F> SystemParamState for QueryState<Q, F> where
Q: 'static + WorldQuery,
F: 'static + WorldQuery,
<F as WorldQuery>::Fetch: FilterFetch,
impl<Q, F> SystemParamState for QueryState<Q, F> where
Q: 'static + WorldQuery,
F: 'static + WorldQuery,
<F as WorldQuery>::Fetch: FilterFetch,
type Config = ()
type Config = ()
Values of this type can be used to adjust the behavior of the
system parameter. For instance, this can be used to pass
values from a Plugin
to a System
, or to control the
behavior of the System
. Read more
pub fn init(
world: &mut World,
system_meta: &mut SystemMeta,
_config: <QueryState<Q, F> as SystemParamState>::Config
) -> QueryState<Q, F>
pub fn new_archetype(
&mut self,
archetype: &Archetype,
system_meta: &mut SystemMeta
)
pub fn default_config()
fn apply(&mut self, _world: &mut World)
impl<Q, F> ReadOnlySystemParamFetch for QueryState<Q, F> where
Q: WorldQuery,
F: WorldQuery,
<Q as WorldQuery>::Fetch: ReadOnlyFetch,
<F as WorldQuery>::Fetch: FilterFetch,
Auto Trait Implementations
impl<Q, F> RefUnwindSafe for QueryState<Q, F> where
<F as WorldQuery>::State: RefUnwindSafe,
<Q as WorldQuery>::State: RefUnwindSafe,
impl<Q, F> Send for QueryState<Q, F>
impl<Q, F> Sync for QueryState<Q, F>
impl<Q, F> Unpin for QueryState<Q, F> where
<F as WorldQuery>::State: Unpin,
<Q as WorldQuery>::State: Unpin,
impl<Q, F> UnwindSafe for QueryState<Q, F> where
<F as WorldQuery>::State: UnwindSafe,
<Q as WorldQuery>::State: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<T> Downcast for T where
T: Any,
impl<T> Downcast for T where
T: Any,
pub fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>ⓘNotable traits for Box<I, A>impl<I, A> Iterator for Box<I, A> where
I: Iterator + ?Sized,
A: Allocator, type Item = <I as Iterator>::Item;impl<F, A> Future for Box<F, A> where
F: Future + Unpin + ?Sized,
A: Allocator + 'static, type Output = <F as Future>::Output;
pub fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>ⓘNotable traits for Box<I, A>impl<I, A> Iterator for Box<I, A> where
I: Iterator + ?Sized,
A: Allocator, type Item = <I as Iterator>::Item;impl<F, A> Future for Box<F, A> where
F: Future + Unpin + ?Sized,
A: Allocator + 'static, type Output = <F as Future>::Output;
I: Iterator + ?Sized,
A: Allocator, type Item = <I as Iterator>::Item;impl<F, A> Future for Box<F, A> where
F: Future + Unpin + ?Sized,
A: Allocator + 'static, type Output = <F as Future>::Output;
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
. Read more
pub fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
pub 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
. Read more
pub fn as_any(&self) -> &(dyn Any + 'static)
pub 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. Read more
pub fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
pub 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. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>ⓘNotable traits for Instrumented<T>impl<T> Future for Instrumented<T> where
T: Future, type Output = <T as Future>::Output;
fn instrument(self, span: Span) -> Instrumented<Self>ⓘNotable traits for Instrumented<T>impl<T> Future for Instrumented<T> where
T: Future, type Output = <T as Future>::Output;
T: Future, type Output = <T as Future>::Output;
sourcefn in_current_span(self) -> Instrumented<Self>ⓘNotable traits for Instrumented<T>impl<T> Future for Instrumented<T> where
T: Future, type Output = <T as Future>::Output;
fn in_current_span(self) -> Instrumented<Self>ⓘNotable traits for Instrumented<T>impl<T> Future for Instrumented<T> where
T: Future, type Output = <T as Future>::Output;
T: Future, type Output = <T as Future>::Output;
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
pub fn vzip(self) -> V
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>ⓘNotable traits for WithDispatch<T>impl<T> Future for WithDispatch<T> where
T: Future, type Output = <T as Future>::Output;
where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>ⓘNotable traits for WithDispatch<T>impl<T> Future for WithDispatch<T> where
T: Future, type Output = <T as Future>::Output;
where
S: Into<Dispatch>,
T: Future, type Output = <T as Future>::Output;
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>ⓘNotable traits for WithDispatch<T>impl<T> Future for WithDispatch<T> where
T: Future, type Output = <T as Future>::Output;
fn with_current_subscriber(self) -> WithDispatch<Self>ⓘNotable traits for WithDispatch<T>impl<T> Future for WithDispatch<T> where
T: Future, type Output = <T as Future>::Output;
T: Future, type Output = <T as Future>::Output;
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more