Function std::num::cast
pub fn cast<T: NumCast, U: NumCast>(n: T) -> Option<U>
Cast from one machine scalar to another.
Example
use std::num; let twenty: f32 = num::cast(0x14).unwrap(); assert_eq!(twenty, 20f32);
pub fn cast<T: NumCast, U: NumCast>(n: T) -> Option<U>
Cast from one machine scalar to another.
use std::num; let twenty: f32 = num::cast(0x14).unwrap(); assert_eq!(twenty, 20f32);
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
).