[]Struct bevy::ecs::prelude::Resources

pub struct Resources { /* fields omitted */ }

A collection of resource instances identified by their type.

Implementations

impl Resources

pub fn insert<T>(&mut self, resource: T) where
    T: Resource

pub fn insert_thread_local<T>(&mut self, resource: T) where
    T: 'static, 

pub fn contains<T>(&self) -> bool where
    T: Resource

pub fn get<T>(&self) -> Option<ResourceRef<'_, T>> where
    T: Resource

pub fn get_mut<T>(&self) -> Option<ResourceRefMut<'_, T>> where
    T: Resource

pub fn get_thread_local<T>(&self) -> Option<ResourceRef<'_, T>> where
    T: 'static, 

pub fn get_thread_local_mut<T>(&self) -> Option<ResourceRefMut<'_, T>> where
    T: 'static, 

pub fn get_or_insert_with<T>(
    &mut self,
    get_resource: impl FnOnce() -> T
) -> ResourceRefMut<'_, T> where
    T: Resource

pub fn get_cloned<T>(&self) -> Option<T> where
    T: Resource + Clone

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<T>(&'a self, id: SystemId) -> Option<ResourceRef<'a, T>> where
    T: Resource

pub fn get_local_mut<T>(&'a self, id: SystemId) -> Option<ResourceRefMut<'a, T>> where
    T: Resource

pub fn insert_local<T>(&mut self, id: SystemId, resource: T) where
    T: Resource

pub unsafe fn get_unsafe_ref<T>(
    &self,
    resource_index: ResourceIndex
) -> NonNull<T> where
    T: Resource

pub unsafe fn get_unsafe_ref_with_added_and_mutated<T>(
    &self,
    resource_index: ResourceIndex
) -> (NonNull<T>, NonNull<bool>, NonNull<bool>) where
    T: Resource

pub fn clear_trackers(&mut self)

Clears each resource's tracker state. For example, each resource's component "mutated" state will be reset to false.

Trait Implementations

impl Default for Resources

impl Send for Resources

impl Sync for Resources

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Any for T where
    T: Any

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Component for T where
    T: 'static + Send + Sync

impl<T> Downcast for T where
    T: Any

impl<T> DowncastSync for T where
    T: Send + Sync + Any

impl<T> From<T> for T[src]

impl<T> FromResources for T where
    T: Default

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Resource for T where
    T: 'static + Send + Sync

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,