Struct bevy_ecs::change_detection::Mut
source · [−]pub struct Mut<'a, T> { /* private fields */ }
Expand description
Unique mutable borrow of an entity’s component
Implementations
sourceimpl<'a, T> Mut<'a, T>
impl<'a, T> Mut<'a, T>
sourcepub fn into_inner(self) -> &'a mut T
pub fn into_inner(self) -> &'a mut T
Consume self
and return a mutable reference to the
contained value while marking self
as “changed”.
Trait Implementations
sourceimpl<'a, T> DetectChanges for Mut<'a, T>
impl<'a, T> DetectChanges for Mut<'a, T>
sourcefn is_changed(&self) -> bool
fn is_changed(&self) -> bool
Returns true
if this value was added or mutably dereferenced after the system last ran.
sourcefn set_changed(&mut self)
fn set_changed(&mut self)
Flags this value as having been changed. Read more
sourcefn last_changed(&self) -> u32
fn last_changed(&self) -> u32
Returns the change tick recording the previous time this component (or resource) was changed. Read more
sourceimpl<'a, T: Resource> From<NonSendMut<'a, T>> for Mut<'a, T>
impl<'a, T: Resource> From<NonSendMut<'a, T>> for Mut<'a, T>
sourcefn from(other: NonSendMut<'a, T>) -> Mut<'a, T>
fn from(other: NonSendMut<'a, T>) -> Mut<'a, T>
Convert this NonSendMut
into a Mut
. This allows keeping the change-detection feature of Mut
while losing the specificity of NonSendMut
.
Auto Trait Implementations
impl<'a, T> RefUnwindSafe for Mut<'a, T> where
T: RefUnwindSafe,
impl<'a, T> Send for Mut<'a, T> where
T: Send,
impl<'a, T> Sync for Mut<'a, T> where
T: Sync,
impl<'a, T> Unpin for Mut<'a, T>
impl<'a, T> !UnwindSafe for Mut<'a, T>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Downcast for T where
T: Any,
impl<T> Downcast for T where
T: Any,
sourcefn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
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
sourcefn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
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
sourcefn as_any(&self) -> &(dyn Any + 'static)
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
sourcefn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
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> DowncastSync for T where
T: Any + Send + Sync,
impl<T> DowncastSync for T where
T: Any + Send + Sync,
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<S, T> ParallelSlice<T> for S where
T: Sync,
S: AsRef<[T]>,
impl<S, T> ParallelSlice<T> for S where
T: Sync,
S: AsRef<[T]>,
sourcefn par_chunk_map<F, R>(
&self,
task_pool: &TaskPool,
chunk_size: usize,
f: F
) -> Vec<R, Global>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
where
F: Fn(&[T]) -> R + Send + Sync,
R: 'static + Send,
fn par_chunk_map<F, R>(
&self,
task_pool: &TaskPool,
chunk_size: usize,
f: F
) -> Vec<R, Global>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
where
F: Fn(&[T]) -> R + Send + Sync,
R: 'static + Send,
A: Allocator,
Splits the slice in chunks of size 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
sourcefn par_splat_map<F, R>(
&self,
task_pool: &TaskPool,
max_tasks: Option<usize>,
f: F
) -> Vec<R, Global>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
where
F: Fn(&[T]) -> R + Send + Sync,
R: 'static + Send,
fn par_splat_map<F, R>(
&self,
task_pool: &TaskPool,
max_tasks: Option<usize>,
f: F
) -> Vec<R, Global>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
where
F: Fn(&[T]) -> R + Send + Sync,
R: 'static + Send,
A: Allocator,
Splits the slice into a maximum of max_tasks
chunks, and maps the chunks in parallel
across the provided task_pool
. One task is spawned in the task pool for every chunk. Read more
sourceimpl<S, T> ParallelSliceMut<T> for S where
T: Send,
S: AsMut<[T]>,
impl<S, T> ParallelSliceMut<T> for S where
T: Send,
S: AsMut<[T]>,
sourcefn par_chunk_map_mut<F, R>(
&mut self,
task_pool: &TaskPool,
chunk_size: usize,
f: F
) -> Vec<R, Global>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
where
F: Fn(&mut [T]) -> R + Send + Sync,
R: 'static + Send,
fn par_chunk_map_mut<F, R>(
&mut self,
task_pool: &TaskPool,
chunk_size: usize,
f: F
) -> Vec<R, Global>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
where
F: Fn(&mut [T]) -> R + Send + Sync,
R: 'static + Send,
A: Allocator,
Splits the slice in chunks of size 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
sourcefn par_splat_map_mut<F, R>(
&mut self,
task_pool: &TaskPool,
max_tasks: Option<usize>,
f: F
) -> Vec<R, Global>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
where
F: Fn(&mut [T]) -> R + Send + Sync,
R: 'static + Send,
fn par_splat_map_mut<F, R>(
&mut self,
task_pool: &TaskPool,
max_tasks: Option<usize>,
f: F
) -> Vec<R, Global>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
where
F: Fn(&mut [T]) -> R + Send + Sync,
R: 'static + Send,
A: Allocator,
Splits the slice into a maximum of max_tasks
chunks, and maps the chunks in parallel
across the provided task_pool
. One task is spawned in the task pool for every chunk. Read more
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more