pub struct Meta {
pub version: u32,
pub markers: BTreeMap<String, f64>,
pub eases: BTreeMap<String, [f64; 4]>,
pub tunables: BTreeMap<String, f64>,
pub audio: Option<AudioMeta>,
pub transition: Option<TransitionMeta>,
pub extra: BTreeMap<String, Value>,
}Expand description
Contents of <scene>.meta.json.
The file is the source of truth for markers, eases and tunables; scene code only provides defaults. Unknown keys are preserved verbatim.
Fields§
§version: u32Schema version, META_SCHEMA_VERSION.
markers: BTreeMap<String, f64>Marker times in seconds from the start of the scene.
eases: BTreeMap<String, [f64; 4]>Named eases as [x1, y1, x2, y2].
tunables: BTreeMap<String, f64>Tunable values.
audio: Option<AudioMeta>Soundtrack placement.
transition: Option<TransitionMeta>Incoming transition length, edited on the timeline.
extra: BTreeMap<String, Value>Keys this version does not know, kept as they are.
Implementations§
Source§impl Meta
impl Meta
Sourcepub fn parse(text: &str) -> Result<Self, MetaError>
pub fn parse(text: &str) -> Result<Self, MetaError>
Parses and validates a meta.json file.
§Errors
If the text is not valid JSON of this shape, has another schema version, or contains an invalid name.
Sourcepub fn validate(&self) -> Result<(), MetaError>
pub fn validate(&self) -> Result<(), MetaError>
Checks that all names are valid.
§Errors
MetaError::InvalidName for the first name that is not [a-z0-9_-]+.
Sourcepub fn to_pretty_string(&self) -> String
pub fn to_pretty_string(&self) -> String
Deterministic formatting: keys sorted at every level, two-space indent, trailing newline — so diffs in git stay readable.