Trait StrOrI64OrUSize

Source
pub trait StrOrI64OrUSize {
    // Required methods
    fn to_i64(&self) -> i64;
    fn to_usize(&self) -> usize;
}
Expand description

A trait representing types that can be converted to either i64 or usize.

Required Methods§

Source

fn to_i64(&self) -> i64

Converts the implementor to an i64.

Source

fn to_usize(&self) -> usize

Converts the implementor to a usize.

Implementations on Foreign Types§

Source§

impl StrOrI64OrUSize for &str

Source§

fn to_i64(&self) -> i64

Converts &str to an i64 using the FNV1a hash algorithm.

Source§

fn to_usize(&self) -> usize

Converts &str to usize, always returning 0.

Source§

impl StrOrI64OrUSize for i64

Source§

fn to_i64(&self) -> i64

Converts i64 to itself.

Source§

fn to_usize(&self) -> usize

Converts i64 to usize, always returning 0.

Source§

impl StrOrI64OrUSize for usize

Source§

fn to_i64(&self) -> i64

Converts usize to i64, always returning 0.

Source§

fn to_usize(&self) -> usize

Converts usize to itself.

Implementors§