pub struct ByteEditBatch<'source> { /* private fields */ }Expand description
Transactional builder for a bounded batch over one immutable source revision.
Every range and before value always refers to source, including edits
submitted by later calls. This is intentionally not a current-document edit
session: accepted edits do not shift coordinates for subsequent admission.
Implementations§
Source§impl<'source> ByteEditBatch<'source>
impl<'source> ByteEditBatch<'source>
Sourcepub fn new(source: &'source str) -> Result<Self, EditError>
pub fn new(source: &'source str) -> Result<Self, EditError>
Starts an empty batch with default hard resource limits.
Sourcepub fn with_limits(
source: &'source str,
limits: BatchLimits,
) -> Result<Self, EditError>
pub fn with_limits( source: &'source str, limits: BatchLimits, ) -> Result<Self, EditError>
Starts an empty batch with explicit hard resource limits.
Sourcepub fn push(&mut self, edit: ByteEdit) -> Result<(), EditError>
pub fn push(&mut self, edit: ByteEdit) -> Result<(), EditError>
Admits one edit or leaves the batch unchanged on failure.
Sourcepub fn push_batch(&mut self, edits: Vec<ByteEdit>) -> Result<(), EditError>
pub fn push_batch(&mut self, edits: Vec<ByteEdit>) -> Result<(), EditError>
Admits every edit atomically, preserving input order at equal offsets.
Sourcepub fn finish(self) -> Result<PreparedEdits<'source>, EditError>
pub fn finish(self) -> Result<PreparedEdits<'source>, EditError>
Consumes the builder without cloning replacement strings.
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
Trait Implementations§
Auto Trait Implementations§
impl<'source> Freeze for ByteEditBatch<'source>
impl<'source> RefUnwindSafe for ByteEditBatch<'source>
impl<'source> Send for ByteEditBatch<'source>
impl<'source> Sync for ByteEditBatch<'source>
impl<'source> Unpin for ByteEditBatch<'source>
impl<'source> UnsafeUnpin for ByteEditBatch<'source>
impl<'source> UnwindSafe for ByteEditBatch<'source>
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