Struct Options
pub struct Options<M> {
pub capture_timeout_millis: u64,
pub tracked_origins: HashSet<Origin>,
pub capture_transaction: Option<Arc<dyn Fn(&TransactionMut<'_>) -> bool + Send + Sync>>,
pub timestamp: Arc<dyn Clock>,
pub init_undo_stack: Vec<StackItem<M>>,
pub init_redo_stack: Vec<StackItem<M>>,
}Expand description
Set of options used to configure UndoManager.
Fields§
§capture_timeout_millis: u64Undo-/redo-able updates are grouped together in time-constrained snapshots. This field determines the period of time, every snapshot will be automatically made in.
tracked_origins: HashSet<Origin>List of origins tracked by corresponding UndoManager. If provided, it will track only updates made within transactions of specific origin. If not provided, it will track only updates made within transaction with no origin defined.
capture_transaction: Option<Arc<dyn Fn(&TransactionMut<'_>) -> bool + Send + Sync>>Custom logic decider, that along with [tracked_origins] can be used to determine if transaction changes should be captured or not.
timestamp: Arc<dyn Clock>Custom clock function, that can be used to generate timestamps used by Options::capture_timeout_millis.
init_undo_stack: Vec<StackItem<M>>Initial undo stack that can be pre-filled with some operations that can be undone.
init_redo_stack: Vec<StackItem<M>>Initial redo stack that can be pre-filled with some operations that can be redone.
Trait Implementations§
Auto Trait Implementations§
impl<M> Freeze for Options<M>
impl<M> !RefUnwindSafe for Options<M>
impl<M> Send for Options<M>where
M: Send,
impl<M> Sync for Options<M>where
M: Sync,
impl<M> Unpin for Options<M>where
M: Unpin,
impl<M> !UnwindSafe for Options<M>
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
§impl<T> CompatExt for T
impl<T> CompatExt for T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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>
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>
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