[][src]Struct bevy::ecs::Resources

pub struct Resources { /* fields omitted */ }

A collection of resource instances identified by their type.

Implementations

impl Resources[src]

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

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

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

pub fn get<T>(&self) -> Option<Ref<'_, T>> where
    T: Resource
[src]

pub fn get_mut<T>(&self) -> Option<RefMut<'_, T>> where
    T: Resource
[src]

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

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

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

pub fn get_cloned<T>(&self) -> Option<T> where
    T: Resource + Clone
[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<T>(&'a self, id: SystemId) -> Option<Ref<'a, T>> where
    T: Resource
[src]

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

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

pub fn query<Q>(
    &self
) -> Option<<<Q as ResourceQuery>::Fetch as FetchResource<'_>>::Item> where
    Q: ResourceQuery
[src]

pub fn query_system<Q>(
    &self,
    id: SystemId
) -> Option<<<Q as ResourceQuery>::Fetch as FetchResource<'_>>::Item> where
    Q: ResourceQuery
[src]

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

pub unsafe fn get_unsafe_ref_with_type_state<T>(
    &self,
    resource_index: ResourceIndex
) -> (NonNull<T>, &TypeState) where
    T: Resource
[src]

pub unsafe fn get_unsafe_added_and_mutated<T>(
    &self,
    resource_index: ResourceIndex
) -> (NonNull<bool>, NonNull<bool>) where
    T: Resource
[src]

pub fn borrow<T>(&self) where
    T: Resource
[src]

pub fn release<T>(&self) where
    T: Resource
[src]

pub fn borrow_mut<T>(&self) where
    T: Resource
[src]

pub fn release_mut<T>(&self) where
    T: Resource
[src]

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

impl Default for Resources[src]

impl Send for Resources[src]

impl Sync for Resources[src]

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
[src]

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
[src]

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>,