pub struct UndoCap {
pub max_count: usize,
pub max_bytes: usize,
}Expand description
The history bound for an UndoStack: a unit-count cap and a total
snapshot byte-size cap (TR-011, TR-024).
Both caps are enforced — whichever binds first drops the oldest unit — so
history stays bounded by count on small edits and by size on large buffers.
A misconfigured (zero) cap is never honored as “unbounded”: construct via
UndoCap::new, which falls back to the defaults for a zero field.
Fields§
§max_count: usizeMaximum number of undo units retained (>= 1).
max_bytes: usizeMaximum total retained snapshot byte-size, in bytes (>= 1).
Implementations§
Trait Implementations§
impl Copy for UndoCap
impl Eq for UndoCap
impl StructuralPartialEq for UndoCap
Auto Trait Implementations§
impl Freeze for UndoCap
impl RefUnwindSafe for UndoCap
impl Send for UndoCap
impl Sync for UndoCap
impl Unpin for UndoCap
impl UnsafeUnpin for UndoCap
impl UnwindSafe for UndoCap
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