pub enum UndoEntry {
Added {
ids: Vec<QueueItemId>,
},
Removed {
items: Vec<(Box<PlaylistItem>, Option<QueueItemId>)>,
},
Inserted {
ids: Vec<QueueItemId>,
},
Moved {
id: QueueItemId,
was_after: Option<QueueItemId>,
},
MovedBatch {
entries: Vec<(QueueItemId, Option<QueueItemId>)>,
},
Replaced {
items: Vec<PlaylistItem>,
cursor: Option<QueueItemId>,
},
Batch(Vec<UndoEntry>),
}Expand description
A reversible playlist operation. Stores enough state to undo/redo.
Each variant describes an action to reverse. apply_entry executes the
reversal and returns the inverse entry for the opposite stack.
Variants§
Added
Items were added (append). Undo = remove by IDs.
Fields
§
ids: Vec<QueueItemId>Removed
Items were removed. Undo = re-add them at their original positions. Each tuple: (item, id-of-predecessor or None if was first).
Fields
§
items: Vec<(Box<PlaylistItem>, Option<QueueItemId>)>Inserted
Items were inserted after a specific item. Undo = remove by IDs.
Fields
§
ids: Vec<QueueItemId>Moved
A single item was moved. Undo = move it back.
MovedBatch
Multiple items were moved. Undo = restore original positions.
Fields
§
entries: Vec<(QueueItemId, Option<QueueItemId>)>Replaced
Playlist was cleared / replaced. Undo = restore this snapshot.
Batch(Vec<UndoEntry>)
Multiple operations batched as a single undo step (e.g. drag reorder).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for UndoEntry
impl RefUnwindSafe for UndoEntry
impl Send for UndoEntry
impl Sync for UndoEntry
impl Unpin for UndoEntry
impl UnsafeUnpin for UndoEntry
impl UnwindSafe for UndoEntry
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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