pub struct Loaded(_);use the three-d-asset crate instead
Implementations
sourceimpl Loaded
impl Loaded
pub fn gltf<P: AsRef<Path>>(
&mut self,
path: P
) -> Result<(Vec<CpuMesh>, Vec<CpuMaterial>)>
use the three-d-asset crate instead
pub fn obj<P: AsRef<Path>>(
&mut self,
path: P
) -> Result<(Vec<CpuMesh>, Vec<CpuMaterial>)>
use the three-d-asset crate instead
pub fn vol<P: AsRef<Path>>(&mut self, path: P) -> Result<CpuVoxelGrid>
use the three-d-asset crate instead
sourcepub fn image<P: AsRef<Path>>(&mut self, path: P) -> Result<CpuTexture>
👎 Deprecated: use the three-d-asset crate instead
pub fn image<P: AsRef<Path>>(&mut self, path: P) -> Result<CpuTexture>
use the three-d-asset crate instead
Deserialize the image resource at the given path into a CpuTexture.
sourcepub fn hdr_image<P: AsRef<Path>>(&mut self, path: P) -> Result<CpuTexture>
👎 Deprecated: use the three-d-asset crate instead
pub fn hdr_image<P: AsRef<Path>>(&mut self, path: P) -> Result<CpuTexture>
use the three-d-asset crate instead
Deserialize the .hdr image resource at the given path into a CpuTexture.
Methods from Deref<Target = RawAssets>
sourcepub fn remove(
&mut self,
path: impl AsRef<Path>
) -> Result<Vec<u8, Global>, Error>
pub fn remove(
&mut self,
path: impl AsRef<Path>
) -> Result<Vec<u8, Global>, Error>
Remove and returns the raw byte array for the resource at the given path.
let mut assets = load(&["test_data/test.png"]).unwrap();
let png_bytes = assets.remove("test.png").unwrap();Note: If no asset has been inserted with the exact same path given as input, then the first asset which path that contains the path given as input is returned. This means the above example can be reduced to:
let png_bytes = load(&["test_data/test.png"]).unwrap().remove("").unwrap();sourcepub fn get(&self, path: impl AsRef<Path>) -> Result<&[u8], Error>
pub fn get(&self, path: impl AsRef<Path>) -> Result<&[u8], Error>
Returns a reference to the raw byte array for the resource at the given path.
let mut assets = load(&["test_data/test.png"]).unwrap();
let png_bytes = assets.get("test.png").unwrap();Note: If no asset has been inserted with the exact same path given as input, then the first asset which path that contains the path given as input is returned. This means the above example can be reduced to:
let png_bytes = load(&["test_data/test.png"]).unwrap().get("").unwrap();sourcepub fn insert(
&mut self,
path: impl AsRef<Path>,
bytes: Vec<u8, Global>
) -> &mut RawAssets
pub fn insert(
&mut self,
path: impl AsRef<Path>,
bytes: Vec<u8, Global>
) -> &mut RawAssets
Inserts the given bytes into the set of raw assets. This is useful if you want to add data from an unsuported source and want to use either the RawAssets::deserialize functionality or RawAssets::save functionality.
let mut assets = RawAssets::new();
assets.insert("test.png", png_bytes);
let texture: Texture2D = assets.deserialize("test.png").unwrap();sourcepub fn extend(&mut self, raw_assets: RawAssets) -> &mut RawAssets
pub fn extend(&mut self, raw_assets: RawAssets) -> &mut RawAssets
Inserts all of the given raw assets into this set of raw assets.
sourcepub fn deserialize<T>(&mut self, path: impl AsRef<Path>) -> Result<T, Error> where
T: Deserialize,
pub fn deserialize<T>(&mut self, path: impl AsRef<Path>) -> Result<T, Error> where
T: Deserialize,
Deserialize the asset with the given path into a type that implements the Deserialize trait.
let mut assets = load(&["test_data/test.png"]).unwrap();
let texture: Texture2D = assets.deserialize("test.png").unwrap();Note: If no asset has been inserted with the exact same path given as input, then the first asset which path that contains the path given as input is deserialized. This means the above example can be reduced to:
let texture: Texture2D = load(&["test_data/test.png"]).unwrap().deserialize("").unwrap();Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Loaded
impl Send for Loaded
impl Sync for Loaded
impl Unpin for Loaded
impl UnwindSafe for Loaded
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
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
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber to this type, returning a
WithDispatch wrapper. Read more