Trait num_convert::Tbits

source ·
pub trait Tbits {
    // Required method
    fn tbits() -> u32;
}
Available on crate feature bits only.
Expand description

Generic trait for define the size of the integers type in bits.

Examples

Usage:

fn get_bits_from_type<T: Tbits>(value: T) -> u32 {
    T::tbits()
}

Required Methods§

source

fn tbits() -> u32

Associated function returns the size of integer type in bits.

Implementations on Foreign Types§

source§

impl Tbits for i16

source§

fn tbits() -> u32

The size of i16 integer type in bits.

source§

impl Tbits for i8

source§

fn tbits() -> u32

The size of i8 integer type in bits.

source§

impl Tbits for usize

source§

fn tbits() -> u32

The size of usize integer type in bits.

source§

impl Tbits for u32

source§

fn tbits() -> u32

The size of u32 integer type in bits.

source§

impl Tbits for i32

source§

fn tbits() -> u32

The size of i32 integer type in bits.

source§

impl Tbits for u16

source§

fn tbits() -> u32

The size of u16 integer type in bits.

source§

impl Tbits for u64

source§

fn tbits() -> u32

The size of u64 integer type in bits.

source§

impl Tbits for i128

source§

fn tbits() -> u32

The size of i128 integer type in bits.

source§

impl Tbits for i64

source§

fn tbits() -> u32

The size of i64 integer type in bits.

source§

impl Tbits for u8

source§

fn tbits() -> u32

The size of u8 integer type in bits.

source§

impl Tbits for u128

source§

fn tbits() -> u32

The size of u128 integer type in bits.

source§

impl Tbits for isize

source§

fn tbits() -> u32

The size of isize integer type in bits.

Implementors§