[][src]Struct shine_gltf::Root

pub struct Root {
    pub accessors: Vec<Accessor>,
    pub animations: Vec<Animation>,
    pub asset: Asset,
    pub buffers: Vec<Buffer>,
    pub buffer_views: Vec<View>,
    pub scene: Option<Index<Scene>>,
    pub extensions: Option<Root>,
    pub extensions_used: Vec<String>,
    pub extensions_required: Vec<String>,
    pub cameras: Vec<Camera>,
    pub images: Vec<Image>,
    pub materials: Vec<Material>,
    pub meshes: Vec<Mesh>,
    pub nodes: Vec<Node>,
    pub samplers: Vec<Sampler>,
    pub scenes: Vec<Scene>,
    pub skins: Vec<Skin>,
    pub textures: Vec<Texture>,
}

The root object of a glTF 2.0 asset.

Fields

accessors: Vec<Accessor>

An array of accessors.

animations: Vec<Animation>

An array of keyframe animations.

asset: Asset

Metadata about the glTF asset.

buffers: Vec<Buffer>

An array of buffers.

buffer_views: Vec<View>

An array of buffer views.

scene: Option<Index<Scene>>

The default scene.

extensions: Option<Root>

Extension specific data.

extensions_used: Vec<String>

Names of glTF extensions used somewhere in this asset.

extensions_required: Vec<String>

Names of glTF extensions required to properly load this asset.

cameras: Vec<Camera>

An array of cameras.

images: Vec<Image>

An array of images.

materials: Vec<Material>

An array of materials.

meshes: Vec<Mesh>

An array of meshes.

nodes: Vec<Node>

An array of nodes.

samplers: Vec<Sampler>

An array of samplers.

scenes: Vec<Scene>

An array of scenes.

skins: Vec<Skin>

An array of skins.

textures: Vec<Texture>

An array of textures.

Methods

impl Root[src]

pub fn get<T>(&self, index: &Index<T>) -> Option<&T> where
    Self: Get<T>, 
[src]

Returns a single item from the root object.

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

Deserialize from a JSON byte slice.

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

Deserialize from a stream of JSON.

pub fn to_string(&self) -> Result<String, Error>[src]

Serialize as a String of JSON.

pub fn to_string_pretty(&self) -> Result<String, Error>[src]

Serialize as a pretty-printed String of JSON.

pub fn to_value(&self) -> Result<Value, Error>[src]

Serialize as a generic JSON value.

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

Serialize as a JSON byte vector.

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

Serialize as a pretty-printed JSON byte vector.

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

Serialize as a JSON byte writertor.

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

Serialize as a pretty-printed JSON byte writertor.

impl Root[src]

pub fn add_accessor(&mut self, data: Accessor) -> Index<Accessor>[src]

impl Root[src]

pub fn add_buffer(&mut self, data: Buffer) -> Index<Buffer>[src]

impl Root[src]

pub fn add_buffer_view(&mut self, data: View) -> Index<View>[src]

impl Root[src]

pub fn add_node(&mut self, data: Node) -> Index<Node>[src]

impl Root[src]

pub fn add_mesh(&mut self, data: Mesh) -> Index<Mesh>[src]

impl Root[src]

pub fn add_scene(&mut self, data: Scene) -> Index<Scene>[src]

Trait Implementations

impl<'a> Get<Accessor> for Root[src]

impl<'a> Get<Animation> for Root[src]

impl<'a> Get<Buffer> for Root[src]

impl<'a> Get<View> for Root[src]

impl<'a> Get<Camera> for Root[src]

impl<'a> Get<Image> for Root[src]

impl<'a> Get<Material> for Root[src]

impl<'a> Get<Mesh> for Root[src]

impl<'a> Get<Node> for Root[src]

impl<'a> Get<Sampler> for Root[src]

impl<'a> Get<Scene> for Root[src]

impl<'a> Get<Skin> for Root[src]

impl<'a> Get<Texture> for Root[src]

impl<'a> GetMut<Accessor> for Root[src]

impl<'a> GetMut<Animation> for Root[src]

impl<'a> GetMut<Buffer> for Root[src]

impl<'a> GetMut<View> for Root[src]

impl<'a> GetMut<Camera> for Root[src]

impl<'a> GetMut<Image> for Root[src]

impl<'a> GetMut<Material> for Root[src]

impl<'a> GetMut<Mesh> for Root[src]

impl<'a> GetMut<Node> for Root[src]

impl<'a> GetMut<Sampler> for Root[src]

impl<'a> GetMut<Scene> for Root[src]

impl<'a> GetMut<Skin> for Root[src]

impl<'a> GetMut<Texture> for Root[src]

impl Validate for Root[src]

impl Default for Root[src]

impl Clone for Root[src]

fn clone_from(&mut self, source: &Self)
1.0.0
[src]

Performs copy-assignment from source. Read more

impl Debug for Root[src]

impl FromStr for Root[src]

type Err = Error

The associated error which can be returned from parsing.

fn from_str(str_: &str) -> Result<Self, Self::Err>[src]

Deserialize from a JSON string slice.

impl Serialize for Root[src]

impl<'de> Deserialize<'de> for Root[src]

Auto Trait Implementations

impl Send for Root

impl Sync for Root

Blanket Implementations

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

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

type Owned = T

The resulting type after obtaining ownership.

impl<T> From for T[src]

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

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto 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> Borrow for T where
    T: ?Sized
[src]

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

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

impl<T> DeserializeOwned for T where
    T: Deserialize<'de>, 
[src]