Skip to main content

BytesAssetProtocol

Struct BytesAssetProtocol 

Source
pub struct BytesAssetProtocol;
Expand description

Protocol implementation for handling generic byte-based assets.

This struct defines how raw bytes representing assets are stored directly without additional processing or transformation.

Trait Implementations§

Source§

impl AssetProtocol for BytesAssetProtocol

Source§

fn name(&self) -> &str

Returns the name of the asset protocol. Read more
Source§

fn process_bytes( &mut self, handle: AssetHandle, storage: &mut World, bytes: Vec<u8>, ) -> Result<(), Box<dyn Error>>

Processes the raw byte data of an asset. Read more
Source§

fn produce_bytes( &mut self, handle: AssetHandle, storage: &mut World, ) -> Result<Vec<u8>, Box<dyn Error>>

Produces raw byte data for an asset. Read more
Source§

fn extract_bundle_from_path( &self, path: &AssetPath<'_>, ) -> Result<DynamicBundle, Box<dyn Error>>

Extracts a dynamic bundle from the given asset path. Read more
Source§

fn rewrite_path( &self, path: AssetPathStatic, ) -> Result<AssetPathStatic, Box<dyn Error>>

Rewrites the asset path before spawning asset in storage. Read more
Source§

fn process_asset_bytes( &mut self, handle: AssetHandle, storage: &mut World, ) -> Result<(), Box<dyn Error>>

Processes an asset by first retrieving its raw byte data and then delegating to process_bytes. Read more
Source§

fn produce_asset_bytes( &mut self, handle: AssetHandle, storage: &mut World, ) -> Result<(), Box<dyn Error>>

Produces an asset by first retrieving its raw byte data and then delegating to produce_bytes. Read more
Source§

fn maintain(&mut self, storage: &mut World) -> Result<(), Box<dyn Error>>

Maintains protocol state. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> Finalize for T

Source§

unsafe fn finalize_raw(data: *mut ())

Safety Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> Component for T
where T: Send + Sync + 'static,