pub struct MarkerEditor { /* private fields */ }Expand description
Manages a collection of editable markers on a timeline.
Implementations§
Source§impl MarkerEditor
impl MarkerEditor
Sourcepub fn add_point(&mut self, position: u64, label: impl Into<String>) -> u64
pub fn add_point(&mut self, position: u64, label: impl Into<String>) -> u64
Add a point marker and return its ID.
Sourcepub fn add_range(
&mut self,
start: u64,
end: u64,
label: impl Into<String>,
) -> u64
pub fn add_range( &mut self, start: u64, end: u64, label: impl Into<String>, ) -> u64
Add a range marker and return its ID.
Sourcepub fn remove(&mut self, id: u64) -> Option<EditMarker>
pub fn remove(&mut self, id: u64) -> Option<EditMarker>
Remove a marker by ID.
Sourcepub fn get(&self, id: u64) -> Option<&EditMarker>
pub fn get(&self, id: u64) -> Option<&EditMarker>
Get a marker by ID.
Sourcepub fn get_mut(&mut self, id: u64) -> Option<&mut EditMarker>
pub fn get_mut(&mut self, id: u64) -> Option<&mut EditMarker>
Get a mutable reference to a marker by ID.
Sourcepub fn sorted(&self) -> Vec<&EditMarker>
pub fn sorted(&self) -> Vec<&EditMarker>
Return all markers sorted by position.
Sourcepub fn filter_by_category(&self, cat: MarkerCategory) -> Vec<&EditMarker>
pub fn filter_by_category(&self, cat: MarkerCategory) -> Vec<&EditMarker>
Filter markers by category.
Sourcepub fn delete_by_category(&mut self, cat: MarkerCategory) -> usize
pub fn delete_by_category(&mut self, cat: MarkerCategory) -> usize
Delete all markers that match a given category.
Sourcepub fn markers_at(&self, pos: u64) -> Vec<&EditMarker>
pub fn markers_at(&self, pos: u64) -> Vec<&EditMarker>
Find all markers whose range contains the given position.
Trait Implementations§
Source§impl Clone for MarkerEditor
impl Clone for MarkerEditor
Source§fn clone(&self) -> MarkerEditor
fn clone(&self) -> MarkerEditor
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for MarkerEditor
impl Debug for MarkerEditor
Auto Trait Implementations§
impl Freeze for MarkerEditor
impl RefUnwindSafe for MarkerEditor
impl Send for MarkerEditor
impl Sync for MarkerEditor
impl Unpin for MarkerEditor
impl UnsafeUnpin for MarkerEditor
impl UnwindSafe for MarkerEditor
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more