[−]Struct bevy::prelude::Assets
Stores Assets of a given type and tracks changes to them.
Implementations
impl<T> Assets<T> where
T: Asset,
T: Asset,
pub fn add(&mut self, asset: T) -> Handle<T>
pub fn set<H>(&mut self, handle: H, asset: T) -> Handle<T> where
H: Into<HandleId>,
H: Into<HandleId>,
pub fn set_untracked<H>(&mut self, handle: H, asset: T) where
H: Into<HandleId>,
H: Into<HandleId>,
pub fn get<H>(&self, handle: H) -> Option<&T> where
H: Into<HandleId>,
H: Into<HandleId>,
pub fn contains<H>(&self, handle: H) -> bool where
H: Into<HandleId>,
H: Into<HandleId>,
pub fn get_mut<H>(&mut self, handle: H) -> Option<&mut T> where
H: Into<HandleId>,
H: Into<HandleId>,
pub fn get_handle<H>(&self, handle: H) -> Handle<T> where
H: Into<HandleId>,
H: Into<HandleId>,
pub fn get_or_insert_with<H>(
&mut self,
handle: H,
insert_fn: impl FnOnce() -> T
) -> &mut T where
H: Into<HandleId>,
&mut self,
handle: H,
insert_fn: impl FnOnce() -> T
) -> &mut T where
H: Into<HandleId>,
pub fn iter(&self) -> impl Iterator<Item = (HandleId, &T)>
pub fn ids(&self) -> impl Iterator<Item = HandleId>
pub fn remove<H>(&mut self, handle: H) -> Option<T> where
H: Into<HandleId>,
H: Into<HandleId>,
pub fn clear(&mut self)
Clears the inner asset map, removing all key-value pairs.
Keeps the allocated memory for reuse.
pub fn reserve(&mut self, additional: usize)
Reserves capacity for at least additional more elements to be inserted into the assets.
The collection may reserve more space to avoid frequent reallocations.
pub fn shrink_to_fit(&mut self)
Shrinks the capacity of the asset map as much as possible.
It will drop down as much as possible while maintaining the internal rules and possibly leaving some space in accordance with the resize policy.
pub fn asset_event_system(
events: ResMut<'_, Events<AssetEvent<T>>>,
assets: ResMut<'_, Assets<T>>
)
events: ResMut<'_, Events<AssetEvent<T>>>,
assets: ResMut<'_, Assets<T>>
)
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
Trait Implementations
Auto Trait Implementations
impl<T> RefUnwindSafe for Assets<T> where
T: RefUnwindSafe,
[src]
T: RefUnwindSafe,
impl<T> Send for Assets<T>
[src]
impl<T> Sync for Assets<T>
[src]
impl<T> Unpin for Assets<T> where
T: Unpin,
[src]
T: Unpin,
impl<T> UnwindSafe for Assets<T> where
T: UnwindSafe,
[src]
T: UnwindSafe,
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, Global>) -> Box<dyn Any + 'static, Global>
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> Instrument for T
[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>ⓘNotable traits for Instrumented<T>
impl<T> Future for Instrumented<T> where
T: Future, type Output = <T as Future>::Output;
[src]
Notable traits for Instrumented<T>
impl<T> Future for Instrumented<T> where
T: Future, type Output = <T as Future>::Output;
pub fn in_current_span(self) -> Instrumented<Self>ⓘNotable traits for Instrumented<T>
impl<T> Future for Instrumented<T> where
T: Future, type Output = <T as Future>::Output;
[src]
Notable traits for Instrumented<T>
impl<T> Future for Instrumented<T> where
T: Future, type Output = <T as Future>::Output;
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,
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>,