funty

Trait Fundamental

Source
pub trait Fundamental:
    'static
    + Sized
    + Send
    + Sync
    + Unpin
    + Clone
    + Copy
    + Default
    + FromStr
    + PartialEq<Self>
    + PartialOrd<Self>
    + Debug
    + Display {
Show 16 methods // Required methods fn as_bool(self) -> bool; fn as_char(self) -> Option<char>; fn as_i8(self) -> i8; fn as_i16(self) -> i16; fn as_i32(self) -> i32; fn as_i64(self) -> i64; fn as_i128(self) -> i128; fn as_isize(self) -> isize; fn as_u8(self) -> u8; fn as_u16(self) -> u16; fn as_u32(self) -> u32; fn as_u64(self) -> u64; fn as_u128(self) -> u128; fn as_usize(self) -> usize; fn as_f32(self) -> f32; fn as_f64(self) -> f64;
}
Expand description

Declare that a type is one of the language fundamental types.

Required Methods§

Source

fn as_bool(self) -> bool

Tests self != 0.

Source

fn as_char(self) -> Option<char>

Represents self as a Unicode Scalar Value, if possible.

Source

fn as_i8(self) -> i8

Performs self as i8.

Source

fn as_i16(self) -> i16

Performs self as i16.

Source

fn as_i32(self) -> i32

Performs self as i32.

Source

fn as_i64(self) -> i64

Performs self as i64.

Source

fn as_i128(self) -> i128

Performs self as i128.

Source

fn as_isize(self) -> isize

Performs self as isize.

Source

fn as_u8(self) -> u8

Performs self as u8.

Source

fn as_u16(self) -> u16

Performs self as u16.

Source

fn as_u32(self) -> u32

Performs self as u32.

Source

fn as_u64(self) -> u64

Performs self as u64.

Source

fn as_u128(self) -> u128

Performs self as u128.

Source

fn as_usize(self) -> usize

Performs self as usize.

Source

fn as_f32(self) -> f32

Performs self as f32.

Source

fn as_f64(self) -> f64

Performs self as f64.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl Fundamental for bool

Source§

fn as_bool(self) -> bool

Source§

fn as_char(self) -> Option<char>

Source§

fn as_i8(self) -> i8

Source§

fn as_i16(self) -> i16

Source§

fn as_i32(self) -> i32

Source§

fn as_i64(self) -> i64

Source§

fn as_i128(self) -> i128

Source§

fn as_isize(self) -> isize

Source§

fn as_u8(self) -> u8

Source§

fn as_u16(self) -> u16

Source§

fn as_u32(self) -> u32

Source§

fn as_u64(self) -> u64

Source§

fn as_u128(self) -> u128

Source§

fn as_usize(self) -> usize

Source§

fn as_f32(self) -> f32

Source§

fn as_f64(self) -> f64

Source§

impl Fundamental for char

Source§

fn as_bool(self) -> bool

Source§

fn as_char(self) -> Option<char>

Source§

fn as_i8(self) -> i8

Source§

fn as_i16(self) -> i16

Source§

fn as_i32(self) -> i32

Source§

fn as_i64(self) -> i64

Source§

fn as_i128(self) -> i128

Source§

fn as_isize(self) -> isize

Source§

fn as_u8(self) -> u8

Source§

fn as_u16(self) -> u16

Source§

fn as_u32(self) -> u32

Source§

fn as_u64(self) -> u64

Source§

fn as_u128(self) -> u128

Source§

fn as_usize(self) -> usize

Source§

fn as_f32(self) -> f32

Source§

fn as_f64(self) -> f64

Source§

impl Fundamental for f32

Source§

fn as_bool(self) -> bool

Source§

fn as_char(self) -> Option<char>

Source§

fn as_i8(self) -> i8

Source§

fn as_i16(self) -> i16

Source§

fn as_i32(self) -> i32

Source§

fn as_i64(self) -> i64

Source§

fn as_i128(self) -> i128

Source§

fn as_isize(self) -> isize

Source§

fn as_u8(self) -> u8

Source§

fn as_u16(self) -> u16

Source§

fn as_u32(self) -> u32

Source§

fn as_u64(self) -> u64

Source§

fn as_u128(self) -> u128

Source§

fn as_usize(self) -> usize

Source§

fn as_f32(self) -> f32

Source§

fn as_f64(self) -> f64

Source§

impl Fundamental for f64

Source§

fn as_bool(self) -> bool

Source§

fn as_char(self) -> Option<char>

Source§

fn as_i8(self) -> i8

Source§

fn as_i16(self) -> i16

Source§

fn as_i32(self) -> i32

Source§

fn as_i64(self) -> i64

Source§

fn as_i128(self) -> i128

Source§

fn as_isize(self) -> isize

Source§

fn as_u8(self) -> u8

Source§

fn as_u16(self) -> u16

Source§

fn as_u32(self) -> u32

Source§

fn as_u64(self) -> u64

Source§

fn as_u128(self) -> u128

Source§

fn as_usize(self) -> usize

Source§

fn as_f32(self) -> f32

Source§

fn as_f64(self) -> f64

Source§

impl Fundamental for i8

Source§

fn as_bool(self) -> bool

Source§

fn as_char(self) -> Option<char>

Source§

fn as_i8(self) -> i8

Source§

fn as_i16(self) -> i16

Source§

fn as_i32(self) -> i32

Source§

fn as_i64(self) -> i64

Source§

fn as_i128(self) -> i128

Source§

fn as_isize(self) -> isize

Source§

fn as_u8(self) -> u8

Source§

fn as_u16(self) -> u16

Source§

fn as_u32(self) -> u32

Source§

fn as_u64(self) -> u64

Source§

fn as_u128(self) -> u128

Source§

fn as_usize(self) -> usize

Source§

fn as_f32(self) -> f32

Source§

fn as_f64(self) -> f64

Source§

impl Fundamental for i16

Source§

fn as_bool(self) -> bool

Source§

fn as_char(self) -> Option<char>

Source§

fn as_i8(self) -> i8

Source§

fn as_i16(self) -> i16

Source§

fn as_i32(self) -> i32

Source§

fn as_i64(self) -> i64

Source§

fn as_i128(self) -> i128

Source§

fn as_isize(self) -> isize

Source§

fn as_u8(self) -> u8

Source§

fn as_u16(self) -> u16

Source§

fn as_u32(self) -> u32

Source§

fn as_u64(self) -> u64

Source§

fn as_u128(self) -> u128

Source§

fn as_usize(self) -> usize

Source§

fn as_f32(self) -> f32

Source§

fn as_f64(self) -> f64

Source§

impl Fundamental for i32

Source§

fn as_bool(self) -> bool

Source§

fn as_char(self) -> Option<char>

Source§

fn as_i8(self) -> i8

Source§

fn as_i16(self) -> i16

Source§

fn as_i32(self) -> i32

Source§

fn as_i64(self) -> i64

Source§

fn as_i128(self) -> i128

Source§

fn as_isize(self) -> isize

Source§

fn as_u8(self) -> u8

Source§

fn as_u16(self) -> u16

Source§

fn as_u32(self) -> u32

Source§

fn as_u64(self) -> u64

Source§

fn as_u128(self) -> u128

Source§

fn as_usize(self) -> usize

Source§

fn as_f32(self) -> f32

Source§

fn as_f64(self) -> f64

Source§

impl Fundamental for i64

Source§

fn as_bool(self) -> bool

Source§

fn as_char(self) -> Option<char>

Source§

fn as_i8(self) -> i8

Source§

fn as_i16(self) -> i16

Source§

fn as_i32(self) -> i32

Source§

fn as_i64(self) -> i64

Source§

fn as_i128(self) -> i128

Source§

fn as_isize(self) -> isize

Source§

fn as_u8(self) -> u8

Source§

fn as_u16(self) -> u16

Source§

fn as_u32(self) -> u32

Source§

fn as_u64(self) -> u64

Source§

fn as_u128(self) -> u128

Source§

fn as_usize(self) -> usize

Source§

fn as_f32(self) -> f32

Source§

fn as_f64(self) -> f64

Source§

impl Fundamental for i128

Source§

fn as_bool(self) -> bool

Source§

fn as_char(self) -> Option<char>

Source§

fn as_i8(self) -> i8

Source§

fn as_i16(self) -> i16

Source§

fn as_i32(self) -> i32

Source§

fn as_i64(self) -> i64

Source§

fn as_i128(self) -> i128

Source§

fn as_isize(self) -> isize

Source§

fn as_u8(self) -> u8

Source§

fn as_u16(self) -> u16

Source§

fn as_u32(self) -> u32

Source§

fn as_u64(self) -> u64

Source§

fn as_u128(self) -> u128

Source§

fn as_usize(self) -> usize

Source§

fn as_f32(self) -> f32

Source§

fn as_f64(self) -> f64

Source§

impl Fundamental for isize

Source§

fn as_bool(self) -> bool

Source§

fn as_char(self) -> Option<char>

Source§

fn as_i8(self) -> i8

Source§

fn as_i16(self) -> i16

Source§

fn as_i32(self) -> i32

Source§

fn as_i64(self) -> i64

Source§

fn as_i128(self) -> i128

Source§

fn as_isize(self) -> isize

Source§

fn as_u8(self) -> u8

Source§

fn as_u16(self) -> u16

Source§

fn as_u32(self) -> u32

Source§

fn as_u64(self) -> u64

Source§

fn as_u128(self) -> u128

Source§

fn as_usize(self) -> usize

Source§

fn as_f32(self) -> f32

Source§

fn as_f64(self) -> f64

Source§

impl Fundamental for u8

Source§

fn as_bool(self) -> bool

Source§

fn as_char(self) -> Option<char>

Source§

fn as_i8(self) -> i8

Source§

fn as_i16(self) -> i16

Source§

fn as_i32(self) -> i32

Source§

fn as_i64(self) -> i64

Source§

fn as_i128(self) -> i128

Source§

fn as_isize(self) -> isize

Source§

fn as_u8(self) -> u8

Source§

fn as_u16(self) -> u16

Source§

fn as_u32(self) -> u32

Source§

fn as_u64(self) -> u64

Source§

fn as_u128(self) -> u128

Source§

fn as_usize(self) -> usize

Source§

fn as_f32(self) -> f32

Source§

fn as_f64(self) -> f64

Source§

impl Fundamental for u16

Source§

fn as_bool(self) -> bool

Source§

fn as_char(self) -> Option<char>

Source§

fn as_i8(self) -> i8

Source§

fn as_i16(self) -> i16

Source§

fn as_i32(self) -> i32

Source§

fn as_i64(self) -> i64

Source§

fn as_i128(self) -> i128

Source§

fn as_isize(self) -> isize

Source§

fn as_u8(self) -> u8

Source§

fn as_u16(self) -> u16

Source§

fn as_u32(self) -> u32

Source§

fn as_u64(self) -> u64

Source§

fn as_u128(self) -> u128

Source§

fn as_usize(self) -> usize

Source§

fn as_f32(self) -> f32

Source§

fn as_f64(self) -> f64

Source§

impl Fundamental for u32

Source§

fn as_bool(self) -> bool

Source§

fn as_char(self) -> Option<char>

Source§

fn as_i8(self) -> i8

Source§

fn as_i16(self) -> i16

Source§

fn as_i32(self) -> i32

Source§

fn as_i64(self) -> i64

Source§

fn as_i128(self) -> i128

Source§

fn as_isize(self) -> isize

Source§

fn as_u8(self) -> u8

Source§

fn as_u16(self) -> u16

Source§

fn as_u32(self) -> u32

Source§

fn as_u64(self) -> u64

Source§

fn as_u128(self) -> u128

Source§

fn as_usize(self) -> usize

Source§

fn as_f32(self) -> f32

Source§

fn as_f64(self) -> f64

Source§

impl Fundamental for u64

Source§

fn as_bool(self) -> bool

Source§

fn as_char(self) -> Option<char>

Source§

fn as_i8(self) -> i8

Source§

fn as_i16(self) -> i16

Source§

fn as_i32(self) -> i32

Source§

fn as_i64(self) -> i64

Source§

fn as_i128(self) -> i128

Source§

fn as_isize(self) -> isize

Source§

fn as_u8(self) -> u8

Source§

fn as_u16(self) -> u16

Source§

fn as_u32(self) -> u32

Source§

fn as_u64(self) -> u64

Source§

fn as_u128(self) -> u128

Source§

fn as_usize(self) -> usize

Source§

fn as_f32(self) -> f32

Source§

fn as_f64(self) -> f64

Source§

impl Fundamental for u128

Source§

fn as_bool(self) -> bool

Source§

fn as_char(self) -> Option<char>

Source§

fn as_i8(self) -> i8

Source§

fn as_i16(self) -> i16

Source§

fn as_i32(self) -> i32

Source§

fn as_i64(self) -> i64

Source§

fn as_i128(self) -> i128

Source§

fn as_isize(self) -> isize

Source§

fn as_u8(self) -> u8

Source§

fn as_u16(self) -> u16

Source§

fn as_u32(self) -> u32

Source§

fn as_u64(self) -> u64

Source§

fn as_u128(self) -> u128

Source§

fn as_usize(self) -> usize

Source§

fn as_f32(self) -> f32

Source§

fn as_f64(self) -> f64

Source§

impl Fundamental for usize

Source§

fn as_bool(self) -> bool

Source§

fn as_char(self) -> Option<char>

Source§

fn as_i8(self) -> i8

Source§

fn as_i16(self) -> i16

Source§

fn as_i32(self) -> i32

Source§

fn as_i64(self) -> i64

Source§

fn as_i128(self) -> i128

Source§

fn as_isize(self) -> isize

Source§

fn as_u8(self) -> u8

Source§

fn as_u16(self) -> u16

Source§

fn as_u32(self) -> u32

Source§

fn as_u64(self) -> u64

Source§

fn as_u128(self) -> u128

Source§

fn as_usize(self) -> usize

Source§

fn as_f32(self) -> f32

Source§

fn as_f64(self) -> f64

Implementors§