pub trait MemLen {
// Required methods
fn to_len(&self) -> usize;
fn to_len_padded(&self, incr: usize) -> usize;
fn to_lens(&self) -> [usize; 3];
}
Expand description
Types which have properties allowing them to be used to define the size of a volume of memory.
Units are expressed in bytes / size_of(T)
just like Vec::len()
.
Required Methods§
sourcefn to_len(&self) -> usize
fn to_len(&self) -> usize
Returns the exact number of elements of a volume of memory
(equivalent to Vec::len()
).
sourcefn to_len_padded(&self, incr: usize) -> usize
fn to_len_padded(&self, incr: usize) -> usize
Returns the length of a volume of memory padded to the next
multiple of incr
.