pub enum AssetSource {
Path(PathBuf),
Bytes(Vec<u8>),
Url(String),
}Expand description
Platform-neutral source for a media or model asset.
Native builds usually load from the filesystem via Path. WASM builds can
receive assets as in-memory bytes, URLs, or Blobs so that no filesystem
access is required.
Currently wired into:
- Scene image/SVG loading (
load_rgba_image_source,load_svg_source) - World background image, directional character sprite, and GLB mesh loading
Not yet implemented:
- Remote URL fetching (native
ureq, WASMfetch) - WebCodecs video encoding output
Variants§
Path(PathBuf)
Native filesystem path.
Bytes(Vec<u8>)
In-memory bytes (e.g. a loaded file or Blob).
Url(String)
Remote URL. Native builds fetch with ureq; WASM builds fetch with
fetch.
Implementations§
Source§impl AssetSource
impl AssetSource
Trait Implementations§
Source§impl Clone for AssetSource
impl Clone for AssetSource
Source§fn clone(&self) -> AssetSource
fn clone(&self) -> AssetSource
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for AssetSource
impl RefUnwindSafe for AssetSource
impl Send for AssetSource
impl Sync for AssetSource
impl Unpin for AssetSource
impl UnsafeUnpin for AssetSource
impl UnwindSafe for AssetSource
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
Mutably borrows from an owned value. Read more