ClampedInteger

Trait ClampedInteger 

Source
pub unsafe trait ClampedInteger<T: Copy>:
    'static
    + Default
    + Eq
    + Ord
    + InherentLimits<T> {
    // Required methods
    fn from_primitive(val: T) -> Result<Self>;
    fn as_primitive(&self) -> &T;

    // Provided methods
    unsafe fn from_primitive_unchecked(val: T) -> Self { ... }
    fn into_primitive(&self) -> T { ... }
}

Required Methods§

Source

fn from_primitive(val: T) -> Result<Self>

Source

fn as_primitive(&self) -> &T

Provided Methods§

Source

unsafe fn from_primitive_unchecked(val: T) -> Self

Source

fn into_primitive(&self) -> T

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 ClampedInteger<i8> for i8

Source§

fn from_primitive(val: i8) -> Result<Self>

Source§

fn as_primitive(&self) -> &i8

Source§

impl ClampedInteger<i16> for i16

Source§

impl ClampedInteger<i32> for i32

Source§

impl ClampedInteger<i64> for i64

Source§

impl ClampedInteger<i128> for i128

Source§

impl ClampedInteger<isize> for isize

Source§

impl ClampedInteger<u8> for u8

Source§

fn from_primitive(val: u8) -> Result<Self>

Source§

fn as_primitive(&self) -> &u8

Source§

impl ClampedInteger<u16> for u16

Source§

impl ClampedInteger<u32> for u32

Source§

impl ClampedInteger<u64> for u64

Source§

impl ClampedInteger<u128> for u128

Source§

impl ClampedInteger<usize> for usize

Implementors§