[−][src]Struct bevy_ecs::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<Ref<'_, T>>
[src]
pub fn get_mut<T: Resource>(&self) -> Option<RefMut<'_, 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
) -> RefMut<'_, T>
[src]
&mut self,
get_resource: impl FnOnce() -> T
) -> RefMut<'_, 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<Ref<'a, T>>
[src]
pub fn get_local_mut<'a, T: Resource>(
&'a self,
id: SystemId
) -> Option<RefMut<'a, T>>
[src]
&'a self,
id: SystemId
) -> Option<RefMut<'a, T>>
pub fn insert_local<T: Resource>(&mut self, id: SystemId, resource: T)
[src]
pub fn query<Q: ResourceQuery>(
&self
) -> Option<<Q::Fetch as FetchResource<'_>>::Item>
[src]
&self
) -> Option<<Q::Fetch as FetchResource<'_>>::Item>
pub fn query_system<Q: ResourceQuery>(
&self,
id: SystemId
) -> Option<<Q::Fetch as FetchResource<'_>>::Item>
[src]
&self,
id: SystemId
) -> Option<<Q::Fetch as FetchResource<'_>>::Item>
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_type_state<T: Resource>(
&self,
resource_index: ResourceIndex
) -> (NonNull<T>, &TypeState)
[src]
&self,
resource_index: ResourceIndex
) -> (NonNull<T>, &TypeState)
pub unsafe fn get_unsafe_added_and_mutated<T: Resource>(
&self,
resource_index: ResourceIndex
) -> (NonNull<bool>, NonNull<bool>)
[src]
&self,
resource_index: ResourceIndex
) -> (NonNull<bool>, NonNull<bool>)
pub fn borrow<T: Resource>(&self)
[src]
pub fn release<T: Resource>(&self)
[src]
pub fn borrow_mut<T: Resource>(&self)
[src]
pub fn release_mut<T: Resource>(&self)
[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
Auto Trait Implementations
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> Component for T where
T: 'static + Send + Sync,
[src]
T: 'static + Send + Sync,
impl<T> Downcast for T where
T: Any,
[src]
T: Any,
pub fn into_any(self: Box<T>) -> Box<dyn Any + 'static>
[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, 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>,