Trait BVSize

Source
pub trait BVSize: Sized {
    // Required methods
    fn from_usize(val: usize) -> Self;
    fn as_usize(&self) -> usize;
    fn max_value() -> Self;
    fn checked_add(self, rhs: Self) -> Option<Self>;
    fn get_size_of() -> Self;
}
Expand description

Represents the generic integral type of the structure size indicators

Required Methods§

Source

fn from_usize(val: usize) -> Self

Returns a Self value casted from an usize value

Source

fn as_usize(&self) -> usize

Returns an usize value casted from a Self value

Source

fn max_value() -> Self

Returns the max value for Self

Source

fn checked_add(self, rhs: Self) -> Option<Self>

Calls the checked_add method of self passing rhs

Source

fn get_size_of() -> Self

Returns the returned value of [std::mem::size_of][1] for Self [1]: http://doc.rust-lang.org/stable/std/mem/fn.size_of.html

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 BVSize for u8

Source§

fn from_usize(val: usize) -> u8

Source§

fn as_usize(&self) -> usize

Source§

fn max_value() -> Self

Source§

fn checked_add(self, rhs: Self) -> Option<u8>

Source§

fn get_size_of() -> Self

Source§

impl BVSize for u16

Source§

fn from_usize(val: usize) -> u16

Source§

fn as_usize(&self) -> usize

Source§

fn max_value() -> Self

Source§

fn checked_add(self, rhs: Self) -> Option<u16>

Source§

fn get_size_of() -> Self

Source§

impl BVSize for u32

Source§

fn from_usize(val: usize) -> u32

Source§

fn as_usize(&self) -> usize

Source§

fn max_value() -> Self

Source§

fn checked_add(self, rhs: Self) -> Option<u32>

Source§

fn get_size_of() -> Self

Source§

impl BVSize for u64

Source§

fn from_usize(val: usize) -> u64

Source§

fn as_usize(&self) -> usize

Source§

fn max_value() -> Self

Source§

fn checked_add(self, rhs: Self) -> Option<u64>

Source§

fn get_size_of() -> Self

Implementors§