pub struct TextOperation { /* private fields */ }Expand description
A text operation consisting of multiple atomic operations
Implementations§
Source§impl TextOperation
impl TextOperation
Sourcepub fn with_base_length(base_length: usize) -> Self
pub fn with_base_length(base_length: usize) -> Self
Creates a text operation from a base length
§Arguments
base_length- The length of the document before this operation
Sourcepub fn apply(&self, text: &str) -> SyncResult<String>
pub fn apply(&self, text: &str) -> SyncResult<String>
Sourcepub fn base_length(&self) -> usize
pub fn base_length(&self) -> usize
Gets the base length
Sourcepub fn target_length(&self) -> usize
pub fn target_length(&self) -> usize
Gets the target length
Sourcepub fn operations(&self) -> &[Operation]
pub fn operations(&self) -> &[Operation]
Gets the operations
Trait Implementations§
Source§impl Clone for TextOperation
impl Clone for TextOperation
Source§fn clone(&self) -> TextOperation
fn clone(&self) -> TextOperation
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for TextOperation
impl Debug for TextOperation
Source§impl Default for TextOperation
impl Default for TextOperation
Source§impl<'de> Deserialize<'de> for TextOperation
impl<'de> Deserialize<'de> for TextOperation
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for TextOperation
impl PartialEq for TextOperation
Source§impl Serialize for TextOperation
impl Serialize for TextOperation
Source§impl Transform for TextOperation
impl Transform for TextOperation
Source§fn transform(&self, other: &Self) -> SyncResult<Self>
fn transform(&self, other: &Self) -> SyncResult<Self>
Transforms this operation against another concurrent operation Read more
Source§fn compose(&self, other: &Self) -> SyncResult<Self>
fn compose(&self, other: &Self) -> SyncResult<Self>
Composes this operation with another sequential operation Read more
Source§fn invert(&self) -> SyncResult<Self>
fn invert(&self) -> SyncResult<Self>
Inverts this operation Read more
impl Eq for TextOperation
impl StructuralPartialEq for TextOperation
Auto Trait Implementations§
impl Freeze for TextOperation
impl RefUnwindSafe for TextOperation
impl Send for TextOperation
impl Sync for TextOperation
impl Unpin for TextOperation
impl UnsafeUnpin for TextOperation
impl UnwindSafe for TextOperation
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