pub trait ErasedAssetSaver:
Send
+ Sync
+ 'static {
// Required methods
fn save<'a>(
&'a self,
writer: &'a mut (dyn AsyncWrite + Sync + Unpin + Send + 'static),
asset: &'a ErasedLoadedAsset,
settings: &'a (dyn Settings + 'static),
) -> Pin<Box<dyn ConditionalSendFuture<Output = Result<(), Box<dyn Error + Sync + Send>>> + 'a>>;
fn type_name(&self) -> &'static str;
}
Expand description
A type-erased dynamic variant of AssetSaver
that allows callers to save assets without knowing the actual type of the AssetSaver
.
Required Methods§
Sourcefn save<'a>(
&'a self,
writer: &'a mut (dyn AsyncWrite + Sync + Unpin + Send + 'static),
asset: &'a ErasedLoadedAsset,
settings: &'a (dyn Settings + 'static),
) -> Pin<Box<dyn ConditionalSendFuture<Output = Result<(), Box<dyn Error + Sync + Send>>> + 'a>>
fn save<'a>( &'a self, writer: &'a mut (dyn AsyncWrite + Sync + Unpin + Send + 'static), asset: &'a ErasedLoadedAsset, settings: &'a (dyn Settings + 'static), ) -> Pin<Box<dyn ConditionalSendFuture<Output = Result<(), Box<dyn Error + Sync + Send>>> + 'a>>
Saves the given runtime ErasedLoadedAsset
by writing it to a byte format using writer
. The passed in settings
can influence how the
asset
is saved.
Sourcefn type_name(&self) -> &'static str
fn type_name(&self) -> &'static str
The type name of the AssetSaver
.