Struct three_d::io::Loaded[][src]

pub struct Loaded<'a> { /* fields omitted */ }
Expand description

The resources loaded using the Loader. Use the bytes function to extract the raw byte array for the loaded resource or one of the other methods to both extract and deserialize a loaded resource.

Implementations

impl<'a> Loaded<'a>[src]

pub fn bytes<P: AsRef<Path>>(&'a self, path: P) -> Result<&'a [u8], IOError>[src]

Returns the loaded byte array for the resource at the given path. The byte array then has to be deserialized to whatever type this resource is (image, 3D model etc.).

impl<'a> Loaded<'a>[src]

pub fn image<P: AsRef<Path>>(
    &'a self,
    path: P
) -> Result<CPUTexture<u8>, IOError>
[src]

Deserialize the loaded image resource at the given path into a CPUTexture using the image crate. The CPUTexture can then be used to create a Texture2D.

Feature

Only available when the image-io feature is enabled.

pub fn cube_image<P: AsRef<Path>>(
    &'a self,
    right_path: P,
    left_path: P,
    top_path: P,
    bottom_path: P,
    front_path: P,
    back_path: P
) -> Result<CPUTexture<u8>, IOError>
[src]

Deserialize the 6 loaded image resources at the given paths into a CPUTexture using the image crate. The CPUTexture can then be used to create a TextureCubeMap.

Feature

Only available when the image-io feature is enabled.

impl<'a> Loaded<'a>[src]

pub fn three_d<P: AsRef<Path>>(
    &'a self,
    path: P
) -> Result<(Vec<CPUMesh>, Vec<CPUMaterial>), IOError>
[src]

Deserialize a loaded .3d file resource (a custom binary format for three-d) into a list of meshes and materials.

Feature

Only available when the 3d-io feature is enabled.

impl<'a> Loaded<'a>[src]

pub fn obj<P: AsRef<Path>>(
    &'a self,
    path: P
) -> Result<(Vec<CPUMesh>, Vec<CPUMaterial>), IOError>
[src]

Deserialize a loaded .obj file resource and .mtl material file resource (if present) into a list of meshes and materials. It uses the wavefront-obj crate.

Feature

Only available when the obj-io feature is enabled.

Auto Trait Implementations

impl<'a> !RefUnwindSafe for Loaded<'a>

impl<'a> Send for Loaded<'a>

impl<'a> Sync for Loaded<'a>

impl<'a> Unpin for Loaded<'a>

impl<'a> !UnwindSafe for Loaded<'a>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

impl<T> From<T> for T[src]

pub fn from(t: T) -> T[src]

Performs the conversion.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

pub fn into(self) -> U[src]

Performs the conversion.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

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

Performs the conversion.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

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

Performs the conversion.