Enum loro_internal::handler::TextDelta
source · pub enum TextDelta {
Retain {
retain: usize,
attributes: Option<FxHashMap<String, LoroValue>>,
},
Insert {
insert: String,
attributes: Option<FxHashMap<String, LoroValue>>,
},
Delete {
delete: usize,
},
}
Variants§
Implementations§
source§impl TextDelta
impl TextDelta
sourcepub fn as_retain_mut(
&mut self
) -> Option<(&mut usize, &mut Option<FxHashMap<String, LoroValue>>)>
pub fn as_retain_mut( &mut self ) -> Option<(&mut usize, &mut Option<FxHashMap<String, LoroValue>>)>
Optionally returns mutable references to the inner fields if this is a TextDelta::Retain
, otherwise None
sourcepub fn as_retain(
&self
) -> Option<(&usize, &Option<FxHashMap<String, LoroValue>>)>
pub fn as_retain( &self ) -> Option<(&usize, &Option<FxHashMap<String, LoroValue>>)>
Optionally returns references to the inner fields if this is a TextDelta::Retain
, otherwise None
sourcepub fn into_retain(
self
) -> Result<(usize, Option<FxHashMap<String, LoroValue>>), Self>
pub fn into_retain( self ) -> Result<(usize, Option<FxHashMap<String, LoroValue>>), Self>
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<FxHashMap<String, LoroValue>>)>
pub fn as_insert_mut( &mut self ) -> Option<(&mut String, &mut Option<FxHashMap<String, LoroValue>>)>
Optionally returns mutable references to the inner fields if this is a TextDelta::Insert
, otherwise None
sourcepub fn as_insert(
&self
) -> Option<(&String, &Option<FxHashMap<String, LoroValue>>)>
pub fn as_insert( &self ) -> Option<(&String, &Option<FxHashMap<String, LoroValue>>)>
Optionally returns references to the inner fields if this is a TextDelta::Insert
, otherwise None
sourcepub fn into_insert(
self
) -> Result<(String, Option<FxHashMap<String, LoroValue>>), Self>
pub fn into_insert( self ) -> Result<(String, Option<FxHashMap<String, LoroValue>>), Self>
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, Self>
pub fn into_delete(self) -> Result<usize, Self>
Returns the inner fields if this is a TextDelta::Delete
, otherwise returns back the enum in the Err
case of the result