pub enum TextDelta {
Retain {
retain: usize,
attributes: Option<HashMap<String, LoroValue, BuildHasherDefault<FxHasher>>>,
},
Insert {
insert: String,
attributes: Option<HashMap<String, LoroValue, BuildHasherDefault<FxHasher>>>,
},
Delete {
delete: usize,
},
}
Variants§
Implementations§
source§impl TextDelta
impl TextDelta
sourcepub fn as_retain_mut(
&mut self
) -> Option<(&mut usize, &mut Option<HashMap<String, LoroValue, BuildHasherDefault<FxHasher>>>)>
pub fn as_retain_mut( &mut self ) -> Option<(&mut usize, &mut Option<HashMap<String, LoroValue, BuildHasherDefault<FxHasher>>>)>
Optionally returns mutable references to the inner fields if this is a TextDelta::Retain
, otherwise None
sourcepub fn as_retain(
&self
) -> Option<(&usize, &Option<HashMap<String, LoroValue, BuildHasherDefault<FxHasher>>>)>
pub fn as_retain( &self ) -> Option<(&usize, &Option<HashMap<String, LoroValue, BuildHasherDefault<FxHasher>>>)>
Optionally returns references to the inner fields if this is a TextDelta::Retain
, otherwise None
sourcepub fn into_retain(
self
) -> Result<(usize, Option<HashMap<String, LoroValue, BuildHasherDefault<FxHasher>>>), TextDelta>
pub fn into_retain( self ) -> Result<(usize, Option<HashMap<String, LoroValue, BuildHasherDefault<FxHasher>>>), TextDelta>
Returns the inner fields if this is a TextDelta::Retain
, otherwise returns back the enum in the Err
case of the result
sourcepub fn as_insert_mut(
&mut self
) -> Option<(&mut String, &mut Option<HashMap<String, LoroValue, BuildHasherDefault<FxHasher>>>)>
pub fn as_insert_mut( &mut self ) -> Option<(&mut String, &mut Option<HashMap<String, LoroValue, BuildHasherDefault<FxHasher>>>)>
Optionally returns mutable references to the inner fields if this is a TextDelta::Insert
, otherwise None
sourcepub fn as_insert(
&self
) -> Option<(&String, &Option<HashMap<String, LoroValue, BuildHasherDefault<FxHasher>>>)>
pub fn as_insert( &self ) -> Option<(&String, &Option<HashMap<String, LoroValue, BuildHasherDefault<FxHasher>>>)>
Optionally returns references to the inner fields if this is a TextDelta::Insert
, otherwise None
sourcepub fn into_insert(
self
) -> Result<(String, Option<HashMap<String, LoroValue, BuildHasherDefault<FxHasher>>>), TextDelta>
pub fn into_insert( self ) -> Result<(String, Option<HashMap<String, LoroValue, BuildHasherDefault<FxHasher>>>), TextDelta>
Returns the inner fields if this is a TextDelta::Insert
, otherwise returns back the enum in the Err
case of the result
sourcepub fn as_delete_mut(&mut self) -> Option<&mut usize>
pub fn as_delete_mut(&mut self) -> Option<&mut usize>
Optionally returns mutable references to the inner fields if this is a TextDelta::Delete
, otherwise None
sourcepub fn as_delete(&self) -> Option<&usize>
pub fn as_delete(&self) -> Option<&usize>
Optionally returns references to the inner fields if this is a TextDelta::Delete
, otherwise None
sourcepub fn into_delete(self) -> Result<usize, TextDelta>
pub fn into_delete(self) -> Result<usize, TextDelta>
Returns the inner fields if this is a TextDelta::Delete
, otherwise returns back the enum in the Err
case of the result
Trait Implementations§
source§impl<'de> Deserialize<'de> for TextDelta
impl<'de> Deserialize<'de> for TextDelta
source§fn deserialize<__D>(
__deserializer: __D
) -> Result<TextDelta, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D
) -> Result<TextDelta, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
source§impl PartialEq for TextDelta
impl PartialEq for TextDelta
source§impl Serialize for TextDelta
impl Serialize for TextDelta
source§fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
impl StructuralPartialEq for TextDelta
Auto Trait Implementations§
impl Freeze for TextDelta
impl RefUnwindSafe for TextDelta
impl Send for TextDelta
impl Sync for TextDelta
impl Unpin for TextDelta
impl UnwindSafe for TextDelta
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
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§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