[−][src]Struct bevy_ecs::prelude::Resources
A collection of resource instances identified by their type.
Implementations
impl Resources
[src]
pub fn insert<T: Resource>(&mut self, resource: T)
[src]
pub fn insert_thread_local<T: 'static>(&mut self, resource: T)
[src]
pub fn contains<T: Resource>(&self) -> bool
[src]
pub fn get<T: Resource>(&self) -> Option<ResourceRef<'_, T>>
[src]
pub fn get_mut<T: Resource>(&self) -> Option<ResourceRefMut<'_, T>>
[src]
pub fn get_thread_local<T: 'static>(&self) -> Option<ResourceRef<'_, T>>
[src]
pub fn get_thread_local_mut<T: 'static>(&self) -> Option<ResourceRefMut<'_, T>>
[src]
pub fn get_or_insert_with<T: Resource>(
&mut self,
get_resource: impl FnOnce() -> T
) -> ResourceRefMut<'_, T>
[src]
&mut self,
get_resource: impl FnOnce() -> T
) -> ResourceRefMut<'_, T>
pub fn get_cloned<T: Resource + Clone>(&self) -> Option<T>
[src]
Returns a clone of the underlying resource, this is helpful when borrowing something cloneable (like a task pool) without taking a borrow on the resource map
pub fn get_local<'a, T: Resource>(
&'a self,
id: SystemId
) -> Option<ResourceRef<'a, T>>
[src]
&'a self,
id: SystemId
) -> Option<ResourceRef<'a, T>>
pub fn get_local_mut<'a, T: Resource>(
&'a self,
id: SystemId
) -> Option<ResourceRefMut<'a, T>>
[src]
&'a self,
id: SystemId
) -> Option<ResourceRefMut<'a, T>>
pub fn insert_local<T: Resource>(&mut self, id: SystemId, resource: T)
[src]
pub unsafe fn get_unsafe_ref<T: Resource>(
&self,
resource_index: ResourceIndex
) -> NonNull<T>
[src]
&self,
resource_index: ResourceIndex
) -> NonNull<T>
pub unsafe fn get_unsafe_ref_with_added_and_mutated<T: Resource>(
&self,
resource_index: ResourceIndex
) -> (NonNull<T>, NonNull<bool>, NonNull<bool>)
[src]
&self,
resource_index: ResourceIndex
) -> (NonNull<T>, NonNull<bool>, NonNull<bool>)
pub fn clear_trackers(&mut self)
[src]
Clears each resource's tracker state.
For example, each resource's component "mutated" state will be reset to false
.
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for Resources
[src]
impl Unpin for Resources
[src]
impl !UnwindSafe for Resources
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Downcast for T where
T: Any,
[src]
T: Any,
pub fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
[src]
pub fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
[src]
pub fn as_any(&self) -> &(dyn Any + 'static)
[src]
pub fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
[src]
impl<T> DowncastSync for T where
T: Send + Sync + Any,
[src]
T: Send + Sync + Any,
impl<T> From<T> for T
[src]
impl<T> Instrument for T
[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,