[][src]Struct gltf::Glb

pub struct Glb<'a> {
    pub header: Header,
    pub json: Cow<'a, [u8]>,
    pub bin: Option<Cow<'a, [u8]>>,
}

Binary glTF contents.

Fields

header: Header

The header section of the .glb file.

json: Cow<'a, [u8]>

The JSON section of the .glb file.

bin: Option<Cow<'a, [u8]>>

The optional BIN section of the .glb file.

Methods

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

pub fn to_writer<W>(&self, writer: W) -> Result<(), Error> where
    W: Write
[src]

Writes binary glTF to a writer.

pub fn to_vec(&self) -> Result<Vec<u8>, Error>[src]

Writes binary glTF to a byte vector.

pub fn from_slice(data: &'a [u8]) -> Result<Self, Error>[src]

Splits loaded GLB into its three chunks.

  • Mandatory GLB header.
  • Mandatory JSON chunk.
  • Optional BIN chunk.

pub fn from_reader<R: Read>(reader: R) -> Result<Self, Error>[src]

Reads binary glTF from a generic stream of data.

Note

Reading terminates early if the stream does not contain valid binary glTF.

Trait Implementations

impl<'a> Clone for Glb<'a>[src]

impl<'a> Debug for Glb<'a>[src]

Auto Trait Implementations

impl<'a> Send for Glb<'a>

impl<'a> Unpin for Glb<'a>

impl<'a> Sync for Glb<'a>

impl<'a> UnwindSafe for Glb<'a>

impl<'a> RefUnwindSafe for Glb<'a>

Blanket Implementations

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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

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

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.

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.

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

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

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