Enum loro_internal::op::ListSlice
source · pub enum ListSlice<'a> {
RawData(Cow<'a, [LoroValue]>),
RawStr {
str: Cow<'a, str>,
unicode_len: usize,
},
}Variants§
Implementations§
source§impl<'a> ListSlice<'a>
impl<'a> ListSlice<'a>
sourcepub fn as_raw_data_mut(&mut self) -> Option<&mut Cow<'a, [LoroValue]>>
pub fn as_raw_data_mut(&mut self) -> Option<&mut Cow<'a, [LoroValue]>>
Optionally returns mutable references to the inner fields if this is a ListSlice::RawData, otherwise None
sourcepub fn as_raw_data(&self) -> Option<&Cow<'a, [LoroValue]>>
pub fn as_raw_data(&self) -> Option<&Cow<'a, [LoroValue]>>
Optionally returns references to the inner fields if this is a ListSlice::RawData, otherwise None
sourcepub fn into_raw_data(self) -> Result<Cow<'a, [LoroValue]>, Self>
pub fn into_raw_data(self) -> Result<Cow<'a, [LoroValue]>, Self>
Returns the inner fields if this is a ListSlice::RawData, otherwise returns back the enum in the Err case of the result
sourcepub fn as_raw_str_mut(&mut self) -> Option<(&mut Cow<'a, str>, &mut usize)>
pub fn as_raw_str_mut(&mut self) -> Option<(&mut Cow<'a, str>, &mut usize)>
Optionally returns mutable references to the inner fields if this is a ListSlice::RawStr, otherwise None
source§impl<'a> ListSlice<'a>
impl<'a> ListSlice<'a>
pub fn unknown_range(len: usize) -> SliceRange
pub fn is_unknown(range: &SliceRange) -> bool
pub fn to_static(&self) -> ListSlice<'static>
Trait Implementations§
source§impl<'de, 'a> Deserialize<'de> for ListSlice<'a>
impl<'de, 'a> Deserialize<'de> for ListSlice<'a>
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<'a> HasLength for ListSlice<'a>
impl<'a> HasLength for ListSlice<'a>
source§fn content_len(&self) -> usize
fn content_len(&self) -> usize
It is the length of the content, i.e. the length when no Mergable::merge ever happen. Read more
source§impl<'a> PartialEq for ListSlice<'a>
impl<'a> PartialEq for ListSlice<'a>
impl<'a> StructuralPartialEq for ListSlice<'a>
Auto Trait Implementations§
impl<'a> RefUnwindSafe for ListSlice<'a>
impl<'a> Send for ListSlice<'a>
impl<'a> Sync for ListSlice<'a>
impl<'a> Unpin for ListSlice<'a>
impl<'a> UnwindSafe for ListSlice<'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