[][src]Trait coca::storage::Capacity

pub unsafe trait Capacity: Copy {
    pub fn from_usize(i: usize) -> Self;
pub fn as_usize(&self) -> usize; }

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.

Loading content...

Implementors

impl Capacity for u8[src]

impl Capacity for u16[src]

impl Capacity for u32[src]

impl Capacity for u64[src]

impl Capacity for usize[src]

Loading content...