KeyList

Struct KeyList 

Source
pub struct KeyList<TRES: TimingResolution + Clone, PRES: ProgressResolution + Eq> { /* private fields */ }
Expand description

List of Progress is stored by ID. Each specific ID has a specific timing and different progress.

Implementations§

Source§

impl<TRES: TimingResolution + Clone, PRES: ProgressResolution + Eq> KeyList<TRES, PRES>

Source

pub fn get_progresses(&self) -> &BTreeMap<u32, ProgressList<TRES, PRES>>

Source

pub fn new(id: u32, time: TRES) -> Self

Source

pub fn new_iter(iter: impl Iterator<Item = (u32, TRES)>) -> Self

Create new with Iterator like [(3,1000), (4,2000)] (id, timing)

Source

pub fn replace_id_iter(&mut self, iter: impl Iterator<Item = (u32, TRES)>)

replace and add new id same as new but replace existing iterator id. non-same id will stay.

Source

pub fn set_time(&mut self, id: u32, time: TRES)

Source

pub fn new_id(&mut self, id: u32, time: TRES)

Source

pub fn change_timing(&mut self, id: u32, new_timing: TRES)

Source

pub fn iter_mut( &mut self, ) -> impl Iterator<Item = (&u32, &mut ProgressList<TRES, PRES>)>

Source

pub fn get(&self, id: u32) -> Option<&ProgressList<TRES, PRES>>

Source

pub fn get_mut(&mut self, id: u32) -> Option<&mut ProgressList<TRES, PRES>>

Source

pub fn start_animation(&mut self, id: u32)

function to start animation.

Source

pub fn get_progress_f32(&mut self, id: u32) -> f32

Trait Implementations§

Source§

impl<TRES: TimingResolution + Clone, PRES: ProgressResolution + Eq> Default for KeyList<TRES, PRES>

Available on crate features std or alloc only.
Source§

fn default() -> Self

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

impl<TRES: TimingResolution + Clone, PRES: ProgressResolution + Eq, const N: usize> From<[TRES; N]> for KeyList<TRES, PRES>

Available on crate features std or alloc only.
Source§

fn from(slice: [TRES; N]) -> Self

Converts to this type from the input type.
Source§

impl<TRES: TimingResolution + Clone, PRES: ProgressResolution + Eq> From<Vec<TRES>> for KeyList<TRES, PRES>

Available on crate features std or alloc only.
Source§

fn from(vec: Vec<TRES>) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

§

impl<TRES, PRES> Freeze for KeyList<TRES, PRES>

§

impl<TRES, PRES> RefUnwindSafe for KeyList<TRES, PRES>
where TRES: RefUnwindSafe, PRES: RefUnwindSafe,

§

impl<TRES, PRES> Send for KeyList<TRES, PRES>
where TRES: Send, PRES: Send,

§

impl<TRES, PRES> Sync for KeyList<TRES, PRES>
where TRES: Sync, PRES: Sync,

§

impl<TRES, PRES> Unpin for KeyList<TRES, PRES>

§

impl<TRES, PRES> UnwindSafe for KeyList<TRES, PRES>
where TRES: RefUnwindSafe, PRES: RefUnwindSafe,

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.