pub struct PatchTransaction<'a> { /* private fields */ }Expand description
Transactional patch executor using copy-on-write rollback semantics.
Implementations§
Source§impl<'a> PatchTransaction<'a>
impl<'a> PatchTransaction<'a>
Sourcepub fn new(document: &'a mut DocumentIr, max_operations: usize) -> Self
pub fn new(document: &'a mut DocumentIr, max_operations: usize) -> Self
Starts a transaction over a document.
Sourcepub fn apply(&mut self, patch: &Patch) -> Result<()>
pub fn apply(&mut self, patch: &Patch) -> Result<()>
Applies the complete patch or restores the exact prior document.
Sourcepub fn apply_with_rollback_snapshot(
&mut self,
patch: &Patch,
) -> Result<DocumentIr>
pub fn apply_with_rollback_snapshot( &mut self, patch: &Patch, ) -> Result<DocumentIr>
Applies a patch and returns the owned rollback snapshot on success.
Sourcepub fn validate(document: &DocumentIr) -> Result<()>
pub fn validate(document: &DocumentIr) -> Result<()>
Validates patch-sensitive document invariants without cloning it.
Auto Trait Implementations§
impl<'a> !UnwindSafe for PatchTransaction<'a>
impl<'a> Freeze for PatchTransaction<'a>
impl<'a> RefUnwindSafe for PatchTransaction<'a>
impl<'a> Send for PatchTransaction<'a>
impl<'a> Sync for PatchTransaction<'a>
impl<'a> Unpin for PatchTransaction<'a>
impl<'a> UnsafeUnpin for PatchTransaction<'a>
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<U, T> ToOwnedObj<U> for Twhere
U: FromObjRef<T>,
impl<U, T> ToOwnedObj<U> for Twhere
U: FromObjRef<T>,
Source§fn to_owned_obj(&self, data: FontData<'_>) -> U
fn to_owned_obj(&self, data: FontData<'_>) -> U
Convert this type into
T, using the provided data to resolve any offsets.