[−][src]Struct gltf::Glb
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]
W: Write,
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
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]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,