[−][src]Trait coca::storage::Capacity
Two-way conversion between Self
and usize
.
Safety
Implementors must ensure the conversion functions are each other's inverse,
i.e. Capacity::from_usize(i).as_usize()
must either evaluate to i
, or
panic for all usize
values.
Using index_type!
should be preferred over implementing this manually.
Required methods
pub fn from_usize(i: usize) -> Self
[src]
Convert a usize
into Self
.
pub fn as_usize(&self) -> usize
[src]
Convert self
into usize
.