pub struct CommandStack<T> { /* private fields */ }Expand description
Historie mit Cursor. limit begrenzt die Zahl gehaltener Befehle.
Implementations§
Source§impl<T> CommandStack<T>
impl<T> CommandStack<T>
pub fn new(limit: usize) -> Self
pub fn limit(&self) -> usize
pub fn len(&self) -> usize
pub fn cursor(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn can_undo(&self) -> bool
pub fn can_redo(&self) -> bool
pub fn description_at(&self, idx: usize) -> Option<&str>
Sourcepub fn last_applied(&self) -> Option<&str>
pub fn last_applied(&self) -> Option<&str>
Letzte angewandte Aktion (für UI-Hinweise).
pub fn next_redo(&self) -> Option<&str>
Sourcepub fn execute(
&mut self,
cmd: Box<dyn Command<T>>,
target: &mut T,
) -> Result<(), String>
pub fn execute( &mut self, cmd: Box<dyn Command<T>>, target: &mut T, ) -> Result<(), String>
Aktion ausführen und in die Historie eintragen.
Auto Trait Implementations§
impl<T> !RefUnwindSafe for CommandStack<T>
impl<T> !Sync for CommandStack<T>
impl<T> !UnwindSafe for CommandStack<T>
impl<T> Freeze for CommandStack<T>
impl<T> Send for CommandStack<T>
impl<T> Unpin for CommandStack<T>
impl<T> UnsafeUnpin for CommandStack<T>
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