gltf_json/
extras.rs

1use gltf_derive::Validate;
2use serde_derive::{Deserialize, Serialize};
3use std::fmt;
4
5#[cfg(feature = "extras")]
6pub use serde_json::value::RawValue;
7
8/// Data type of the `extras` attribute on all glTF objects.
9#[cfg(feature = "extras")]
10pub type Extras = Option<::std::boxed::Box<RawValue>>;
11
12/// Data type of the `extras` attribute on all glTF objects.
13#[cfg(not(feature = "extras"))]
14pub type Extras = Void;
15
16/// Type representing no user-defined data.
17#[derive(Clone, Default, Serialize, Deserialize, Validate)]
18pub struct Void {
19    #[serde(default, skip_serializing)]
20    _allow_unknown_fields: (),
21}
22
23impl fmt::Debug for Void {
24    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
25        write!(f, "{{}}")
26    }
27}
28
29impl fmt::Display for Void {
30    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
31        write!(f, "{{}}")
32    }
33}