pub trait NumCast { fn from<T: NumCast>(n: T) -> Self; fn to_u8(&self) -> u8; fn to_u16(&self) -> u16; fn to_u32(&self) -> u32; fn to_u64(&self) -> u64; fn to_uint(&self) -> uint; fn to_i8(&self) -> i8; fn to_i16(&self) -> i16; fn to_i32(&self) -> i32; fn to_i64(&self) -> i64; fn to_int(&self) -> int; fn to_f32(&self) -> f32; fn to_f64(&self) -> f64; fn to_float(&self) -> float; }
An interface for casting between machine scalars
fn from<T: NumCast>(n: T) -> Self
fn to_u8(&self) -> u8
fn to_u16(&self) -> u16
fn to_u32(&self) -> u32
fn to_u64(&self) -> u64
fn to_uint(&self) -> uint
fn to_i8(&self) -> i8
fn to_i16(&self) -> i16
fn to_i32(&self) -> i32
fn to_i64(&self) -> i64
fn to_int(&self) -> int
fn to_f32(&self) -> f32
fn to_f64(&self) -> f64
fn to_float(&self) -> float
Prefix searches with a type followed by a colon (e.g.
fn:
) to restrict the search to a given type.
Accepted types are: fn
, mod
,
struct
(or str
), enum
,
trait
, typedef
(or
tdef
).