pub trait HasLength {
// Required method
fn content_len(&self) -> usize;
// Provided method
fn atom_len(&self) -> usize { ... }
}
Required Methods§
sourcefn 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.
However, when the content is deleted, HasLength::content_len is expected to be zero in some [crate::RleTree] use cases
Provided Methods§
sourcefn atom_len(&self) -> usize
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 AppendOnlyBytes
impl HasLength for AppendOnlyBytes
fn content_len(&self) -> usize
source§impl HasLength for BytesSlice
impl HasLength for BytesSlice
fn content_len(&self) -> usize
source§impl<A, T: HasLength> HasLength for (A, T)
impl<A, T: HasLength> HasLength for (A, T)
this can make iter return type has len
fn content_len(&self) -> usize
source§impl<T: Integer + NumCast + Copy> HasLength for Range<T>
impl<T: Integer + NumCast + Copy> HasLength for Range<T>
fn content_len(&self) -> usize
source§impl<T: HasLength> HasLength for &T
impl<T: HasLength> HasLength for &T
this can make iter return type has len