pub trait List: Deref<Target = [Self::Item]> {
type Item: Pod;
type Length: PodLength;
// Required method
fn capacity(&self) -> usize;
// Provided methods
fn bytes_used(&self) -> Result<usize, ProgramError> { ... }
fn bytes_allocated(&self) -> Result<usize, ProgramError> { ... }
}Expand description
A trait to abstract the shared, read-only behavior
between ListViewReadOnly and ListViewMut.
Required Associated Types§
Required Methods§
Provided Methods§
Sourcefn bytes_used(&self) -> Result<usize, ProgramError>
fn bytes_used(&self) -> Result<usize, ProgramError>
Returns the number of bytes currently occupied by the live elements
Sourcefn bytes_allocated(&self) -> Result<usize, ProgramError>
fn bytes_allocated(&self) -> Result<usize, ProgramError>
Returns the number of bytes reserved by the entire backing buffer.