pub struct StudioCommandStack<const CAP: usize = 128> { /* private fields */ }Expand description
Bounded zero-heap reversible command stack (CAP = 128 by default).
Implementations§
Source§impl<const CAP: usize> StudioCommandStack<CAP>
impl<const CAP: usize> StudioCommandStack<CAP>
Sourcepub const fn undo_count(&self) -> usize
pub const fn undo_count(&self) -> usize
Number of commands available to undo.
Sourcepub const fn redo_count(&self) -> usize
pub const fn redo_count(&self) -> usize
Number of commands available to redo.
pub const fn can_undo(&self) -> bool
pub const fn can_redo(&self) -> bool
Sourcepub fn execute(
&mut self,
cmd: StudioCommand,
inspector: &mut StudioNodeInspector10D,
)
pub fn execute( &mut self, cmd: StudioCommand, inspector: &mut StudioNodeInspector10D, )
Pushes a new command onto the stack (truncating any redo tail). If the stack is full, shifts the oldest entry out so capacity remains strictly bounded in zero heap.
Sourcepub fn execute_coalesced(
&mut self,
cmd: StudioCommand,
coalesce: bool,
inspector: &mut StudioNodeInspector10D,
)
pub fn execute_coalesced( &mut self, cmd: StudioCommand, coalesce: bool, inspector: &mut StudioNodeInspector10D, )
Executes cmd, coalescing it with the top undo entry if coalesce == true and both
target the same node & variant (e.g., during a continuous gizmo drag).
Sourcepub fn undo(
&mut self,
inspector: &mut StudioNodeInspector10D,
) -> Option<StudioCommand>
pub fn undo( &mut self, inspector: &mut StudioNodeInspector10D, ) -> Option<StudioCommand>
Undoes the most recent command, applying its inverse to inspector and returning the
inverted command.
Sourcepub fn redo(
&mut self,
inspector: &mut StudioNodeInspector10D,
) -> Option<StudioCommand>
pub fn redo( &mut self, inspector: &mut StudioNodeInspector10D, ) -> Option<StudioCommand>
Redoes the next command in the redo tail, applying it to inspector.
Trait Implementations§
Source§impl<const CAP: usize> Clone for StudioCommandStack<CAP>
impl<const CAP: usize> Clone for StudioCommandStack<CAP>
Source§impl<const CAP: usize> Debug for StudioCommandStack<CAP>
impl<const CAP: usize> Debug for StudioCommandStack<CAP>
Auto Trait Implementations§
impl<const CAP: usize> Freeze for StudioCommandStack<CAP>
impl<const CAP: usize> RefUnwindSafe for StudioCommandStack<CAP>
impl<const CAP: usize> Send for StudioCommandStack<CAP>
impl<const CAP: usize> Sync for StudioCommandStack<CAP>
impl<const CAP: usize> Unpin for StudioCommandStack<CAP>
impl<const CAP: usize> UnsafeUnpin for StudioCommandStack<CAP>
impl<const CAP: usize> UnwindSafe for StudioCommandStack<CAP>
Blanket Implementations§
§impl<S, A> Aggregate<Result<S, Error>> for Awhere
A: Aggregate<S>,
impl<S, A> Aggregate<Result<S, Error>> for Awhere
A: Aggregate<S>,
Aggregate shares in an MPC protocol.
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,
§impl<T> InitializeFromFunction<T> for T
impl<T> InitializeFromFunction<T> for T
§fn initialize_from_function(f: fn() -> T) -> T
fn initialize_from_function(f: fn() -> T) -> T
Create an instance of this type from an initialization function
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> 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§impl<T> NoneValue for Twhere
T: Default,
impl<T> NoneValue for Twhere
T: Default,
type NoneType = T
§fn null_value() -> T
fn null_value() -> T
The none-equivalent value.
§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
§impl<T, O> SuperFrom<T> for Owhere
O: From<T>,
impl<T, O> SuperFrom<T> for Owhere
O: From<T>,
§fn super_from(input: T) -> O
fn super_from(input: T) -> O
Convert from a type to another type.
§impl<T, O, M> SuperInto<O, M> for Twhere
O: SuperFrom<T, M>,
impl<T, O, M> SuperInto<O, M> for Twhere
O: SuperFrom<T, M>,
§fn super_into(self) -> O
fn super_into(self) -> O
Convert from a type to another type.