Struct bevy_asset::DirectNestedLoader
source · pub struct DirectNestedLoader<'ctx, 'builder, 'reader> { /* private fields */ }
Expand description
Implementations§
source§impl<'ctx: 'reader, 'builder, 'reader> DirectNestedLoader<'ctx, 'builder, 'reader>
impl<'ctx: 'reader, 'builder, 'reader> DirectNestedLoader<'ctx, 'builder, 'reader>
sourcepub fn with_reader(self, reader: &'builder mut Reader<'reader>) -> Self
pub fn with_reader(self, reader: &'builder mut Reader<'reader>) -> Self
Specify the reader to use to read the asset data.
sourcepub fn untyped(self) -> UntypedDirectNestedLoader<'ctx, 'builder, 'reader>
pub fn untyped(self) -> UntypedDirectNestedLoader<'ctx, 'builder, 'reader>
Load the asset without providing static type information.
If you need to specify the type of asset, but cannot do it statically,
use .with_asset_type_id()
.
sourcepub async fn load<'p, A: Asset>(
self,
path: impl Into<AssetPath<'p>>
) -> Result<LoadedAsset<A>, LoadDirectError>
pub async fn load<'p, A: Asset>( self, path: impl Into<AssetPath<'p>> ) -> Result<LoadedAsset<A>, LoadDirectError>
Loads the asset at the given path
directly. This is an async function that will wait until the asset is fully loaded before
returning. Use this if you need the value of another asset in order to load the current asset. For example, if you are
deriving a new asset from the referenced asset, or you are building a collection of assets. This will add the path
as a
“load dependency”.
If the current loader is used in a Process
“asset preprocessor”, such as a LoadTransformAndSave
preprocessor,
changing a “load dependency” will result in re-processing of the asset.
Auto Trait Implementations§
impl<'ctx, 'builder, 'reader> Freeze for DirectNestedLoader<'ctx, 'builder, 'reader>
impl<'ctx, 'builder, 'reader> !RefUnwindSafe for DirectNestedLoader<'ctx, 'builder, 'reader>
impl<'ctx, 'builder, 'reader> Send for DirectNestedLoader<'ctx, 'builder, 'reader>
impl<'ctx, 'builder, 'reader> Sync for DirectNestedLoader<'ctx, 'builder, 'reader>
impl<'ctx, 'builder, 'reader> Unpin for DirectNestedLoader<'ctx, 'builder, 'reader>
impl<'ctx, 'builder, 'reader> !UnwindSafe for DirectNestedLoader<'ctx, 'builder, 'reader>
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
.source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.