pub struct Ref<'w, T: ?Sized> { /* private fields */ }Expand description
A custom version of bevy’s Ref that can be
constructed from EntityRef and mapped over.
Due to a limitation in bevy, it’s impossible to use the bevy Ref for this crate.
Implementations§
Source§impl<'w, T: ?Sized> Ref<'w, T>
impl<'w, T: ?Sized> Ref<'w, T>
Sourcepub const fn is_added(&self) -> bool
pub const fn is_added(&self) -> bool
Was this added since last time the system this is called from ran?
Sourcepub const fn is_changed(&self) -> bool
pub const fn is_changed(&self) -> bool
Was this changed since last time the system this is called from ran?
Sourcepub const fn into_inner(self) -> &'w T
pub const fn into_inner(self) -> &'w T
Return the inner reference with its full lifetime.
Rust’s Deref trait can’t produce references with a lifetime longer
than that of the Ref itself (with &'a Ref<'w>, the lifetime will
always be 'a).
This can become an issue in certain scenarios, this is why this method exists.
Note that since Ref is Copy, this doesn’t consume the value, you
can keep using it.
Sourcepub fn map_failable<E, U: ?Sized>(
self,
f: impl FnOnce(&T) -> Result<&U, E>,
) -> Result<Ref<'w, U>, E>
pub fn map_failable<E, U: ?Sized>( self, f: impl FnOnce(&T) -> Result<&U, E>, ) -> Result<Ref<'w, U>, E>
Apply a function f returning a result to the inner value,
and get a Ref with the return value of that function.
Returning Err if f returns Err.
§Errors
Returns Err if f returns Err.
Trait Implementations§
Source§impl<'w, 'a, T> IntoIterator for &'a Ref<'w, T>where
&'a T: IntoIterator,
impl<'w, 'a, T> IntoIterator for &'a Ref<'w, T>where
&'a T: IntoIterator,
Source§impl<'w, T: Ord + ?Sized> Ord for Ref<'w, T>
impl<'w, T: Ord + ?Sized> Ord for Ref<'w, T>
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl<'w, T: PartialOrd + ?Sized> PartialOrd for Ref<'w, T>
impl<'w, T: PartialOrd + ?Sized> PartialOrd for Ref<'w, T>
impl<'w, T: Copy + ?Sized> Copy for Ref<'w, T>
impl<'w, T: Eq + ?Sized> Eq for Ref<'w, T>
impl<'w, T: ?Sized> StructuralPartialEq for Ref<'w, T>
Auto Trait Implementations§
impl<'w, T> Freeze for Ref<'w, T>where
T: ?Sized,
impl<'w, T> RefUnwindSafe for Ref<'w, T>where
T: RefUnwindSafe + ?Sized,
impl<'w, T> Send for Ref<'w, T>
impl<'w, T> Sync for Ref<'w, T>
impl<'w, T> Unpin for Ref<'w, T>where
T: ?Sized,
impl<'w, T> UnwindSafe for Ref<'w, T>where
T: RefUnwindSafe + ?Sized,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
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.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<S, T> ParallelSlice<T> for S
impl<S, T> ParallelSlice<T> for S
Source§fn par_chunk_map<F, R>(
&self,
task_pool: &TaskPool,
chunk_size: usize,
f: F,
) -> Vec<R>
fn par_chunk_map<F, R>( &self, task_pool: &TaskPool, chunk_size: usize, f: F, ) -> Vec<R>
chunks_size or less and maps the chunks
in parallel across the provided task_pool. One task is spawned in the task pool
for every chunk. Read more