Struct bevy_ecs::change_detection::ResMut
source · [−]pub struct ResMut<'a, T: Resource> { /* private fields */ }Expand description
Unique mutable borrow of a resource.
See the World documentation to see the usage of a resource.
If you need a shared borrow, use Res instead.
Panics
Panics when used as a SystemParam if the resource does not exist.
Use Option<ResMut<T>> instead if the resource might not always exist.
Implementations
Trait Implementations
sourceimpl<'a, T: Resource> DetectChanges for ResMut<'a, T>
impl<'a, T: Resource> DetectChanges for ResMut<'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> SystemParam for ResMut<'a, T>
impl<'a, T: Resource> SystemParam for ResMut<'a, T>
type Fetch = ResMutState<T>
Auto Trait Implementations
impl<'a, T> RefUnwindSafe for ResMut<'a, T> where
T: RefUnwindSafe,
impl<'a, T> Send for ResMut<'a, T>
impl<'a, T> Sync for ResMut<'a, T>
impl<'a, T> Unpin for ResMut<'a, T>
impl<'a, T> !UnwindSafe for ResMut<'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