pub struct Animation {
pub name: Option<String>,
pub global_duration: Option<f32>,
pub tracks: Vec<Box<dyn TrackTrait>>,
}Expand description
The overarching type for animations
This type implements serde::Deserialize and is meant to be deserealized from an AnimJ (JSON) structure
There are also functions for writing and reading AnimX streams (Binary)
Fields§
§name: Option<String>§global_duration: Option<f32>§tracks: Vec<Box<dyn TrackTrait>>Implementations§
Source§impl Animation
impl Animation
Sourcepub fn write_animx(&self, buf: impl Write)
pub fn write_animx(&self, buf: impl Write)
Function for writing data as an AnimX stream
Compression is not yet supported.
use resonite_core::animation::Animation;
let anim: Animation = serde_json::from_str(/* AnimJ */)?;
let mut buf = Vec::new();
anim.write_animx(&mut buf);Sourcepub fn from_animx(data: impl Read) -> Result<Animation, AnimXError>
pub fn from_animx(data: impl Read) -> Result<Animation, AnimXError>
Function for reading data from an AnimX stream
Compression is not yet supported.
use resonite_core::animation::Animation;
let reader = BufReader::new(/* AnimX */);
let anim = Animation::from_animx(reader)?;Trait Implementations§
Source§impl<'de> Deserialize<'de> for Animation
impl<'de> Deserialize<'de> for Animation
Source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for Animation
impl !RefUnwindSafe for Animation
impl !Send for Animation
impl !Sync for Animation
impl Unpin for Animation
impl !UnwindSafe for Animation
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more