Trait loro_rle::HasLength

source ·
pub trait HasLength {
    // Required method
    fn content_len(&self) -> usize;

    // Provided method
    fn atom_len(&self) -> usize { ... }
}

Required Methods§

source

fn content_len(&self) -> usize

It is the length of the content, i.e. the length when no Mergable::merge ever happen.

However, when the content is deleted, HasLength::content_len is expected to be zero in some [crate::RleTree] use cases

Provided Methods§

source

fn atom_len(&self) -> usize

It is the length of the atom element underneath, i.e. the length when no Mergable::merge ever happen.

It is the same as HasLength::atom_len in the most of the cases. However, oppose to HasLength::atom_len, when the content is deleted, HasLength::content_len should not change

Implementations on Foreign Types§

source§

impl HasLength for String

source§

impl HasLength for AppendOnlyBytes

source§

impl HasLength for BytesSlice

source§

impl<A, T: HasLength> HasLength for (A, T)

this can make iter return type has len

source§

impl<T> HasLength for Vec<T>

source§

impl<T: Integer + NumCast + Copy> HasLength for Range<T>

source§

impl<T: HasLength> HasLength for &T

this can make iter return type has len

Implementors§