Timeline

Struct Timeline 

Source
pub struct Timeline {
    pub tracks: HashMap<String, TrackVariant>,
}

Fields§

§tracks: HashMap<String, TrackVariant>

Implementations§

Source§

impl Timeline

Source

pub fn new() -> Timeline

Source

pub fn add<T>(&mut self, name: &str, track: T)
where T: Into<TrackVariant>,

Source

pub fn get<'a, T>(&'a self, name: &str) -> Option<&'a T>
where &'a T: From<&'a TrackVariant>,

Source

pub fn get_mut<'a, T>(&'a mut self, name: &str) -> Option<&'a mut T>
where &'a mut T: From<&'a mut TrackVariant>,

Source

pub fn get_value(&self, name: &str, time: Duration) -> TrackValue

Source

pub fn get_max_duration(&self) -> Duration

returns max duration of all tracks

Trait Implementations§

Source§

impl Debug for Timeline

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Timeline

Source§

fn default() -> Timeline

Returns the “default value” for a type. Read more
Source§

impl TimelineJsonLoader for Timeline

Source§

fn load_json<T>(&mut self, track_name: &str, json_path: &str) -> Result<()>
where TrackVariant: From<Track<T>>, T: Copy + DeserializeOwned + JsonLoaderWrapper<T>,

Source§

fn load_json_str<T>(&mut self, track_name: &str, json: &str) -> Result<()>
where TrackVariant: From<Track<T>>, T: Copy + DeserializeOwned + JsonLoaderWrapper<T>,

Source§

impl TimelineXMLLoader for Timeline

Source§

fn load_xml<T>(&mut self, track_name: &str, xml_path: &str) -> Result<()>
where TrackVariant: From<Track<T>>, T: Copy + DeserializeOwned + JsonLoaderWrapper<T>,

Source§

fn load_xml_str<T>(&mut self, track_name: &str, xml: &str) -> Result<()>
where TrackVariant: From<Track<T>>, T: Copy + DeserializeOwned + JsonLoaderWrapper<T>,

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.