[−][src]Struct bevy::ecs::Resources
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]
T: Resource,
pub fn insert_thread_local<T>(&mut self, resource: T) where
T: 'static,
[src]
T: 'static,
pub fn contains<T>(&self) -> bool where
T: Resource,
[src]
T: Resource,
pub fn get<T>(&self) -> Option<Ref<'_, T>> where
T: Resource,
[src]
T: Resource,
pub fn get_mut<T>(&self) -> Option<RefMut<'_, T>> where
T: Resource,
[src]
T: Resource,
pub fn get_thread_local<T>(&self) -> Option<ResourceRef<'_, T>> where
T: 'static,
[src]
T: 'static,
pub fn get_thread_local_mut<T>(&self) -> Option<ResourceRefMut<'_, T>> where
T: 'static,
[src]
T: 'static,
pub fn get_or_insert_with<T>(
&mut self,
get_resource: impl FnOnce() -> T
) -> RefMut<'_, T> where
T: Resource,
[src]
&mut self,
get_resource: impl FnOnce() -> T
) -> RefMut<'_, T> where
T: Resource,
pub fn get_cloned<T>(&self) -> Option<T> where
T: Resource + Clone,
[src]
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<Ref<'a, T>> where
T: Resource,
[src]
T: Resource,
pub fn get_local_mut<T>(&'a self, id: SystemId) -> Option<RefMut<'a, T>> where
T: Resource,
[src]
T: Resource,
pub fn insert_local<T>(&mut self, id: SystemId, resource: T) where
T: Resource,
[src]
T: Resource,
pub fn query<Q>(
&self
) -> Option<<<Q as ResourceQuery>::Fetch as FetchResource<'_>>::Item> where
Q: ResourceQuery,
[src]
&self
) -> Option<<<Q as ResourceQuery>::Fetch as FetchResource<'_>>::Item> where
Q: ResourceQuery,
pub fn query_system<Q>(
&self,
id: SystemId
) -> Option<<<Q as ResourceQuery>::Fetch as FetchResource<'_>>::Item> where
Q: ResourceQuery,
[src]
&self,
id: SystemId
) -> Option<<<Q as ResourceQuery>::Fetch as FetchResource<'_>>::Item> where
Q: ResourceQuery,
pub unsafe fn get_unsafe_ref<T>(
&self,
resource_index: ResourceIndex
) -> NonNull<T> where
T: Resource,
[src]
&self,
resource_index: ResourceIndex
) -> NonNull<T> where
T: Resource,
pub unsafe fn get_unsafe_ref_with_type_state<T>(
&self,
resource_index: ResourceIndex
) -> (NonNull<T>, &TypeState) where
T: Resource,
[src]
&self,
resource_index: ResourceIndex
) -> (NonNull<T>, &TypeState) where
T: Resource,
pub unsafe fn get_unsafe_added_and_mutated<T>(
&self,
resource_index: ResourceIndex
) -> (NonNull<bool>, NonNull<bool>) where
T: Resource,
[src]
&self,
resource_index: ResourceIndex
) -> (NonNull<bool>, NonNull<bool>) where
T: Resource,
pub fn borrow<T>(&self) where
T: Resource,
[src]
T: Resource,
pub fn release<T>(&self) where
T: Resource,
[src]
T: Resource,
pub fn borrow_mut<T>(&self) where
T: Resource,
[src]
T: Resource,
pub fn release_mut<T>(&self) where
T: Resource,
[src]
T: Resource,
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> Any for T where
T: Any,
T: Any,
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,
T: 'static + Send + Sync,
impl<T> Downcast for T where
T: Any,
T: Any,
pub fn into_any(self: Box<T>) -> Box<dyn Any + 'static>
pub fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
pub fn as_any(&self) -> &(dyn Any + 'static)
pub fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
impl<T> DowncastSync for T where
T: Send + Sync + Any,
T: Send + Sync + Any,
impl<T> From<T> for T
[src]
impl<T> FromResources for T where
T: Default,
[src]
T: Default,
pub fn from_resources(_resources: &Resources) -> T
[src]
impl<T> Instrument for T
[src]
fn instrument(self, span: Span) -> Instrumented<Self>
[src]
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> Resource for T where
T: 'static + Send + Sync,
[src]
T: 'static + Send + Sync,
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>,