Trait Simple16

Source
pub unsafe trait Simple16: Sized + Copy {
    // Required methods
    fn check(data: &[Self]) -> Result<(), ValueOutOfRange>;
    fn as_(self) -> u32;
}
Expand description

This trait is unsafe because if check is wrong then undefined behavior can occur.

Required Methods§

Source

fn check(data: &[Self]) -> Result<(), ValueOutOfRange>

Source

fn as_(self) -> u32

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

Source§

fn check(_data: &[Self]) -> Result<(), ValueOutOfRange>

Source§

fn as_(self) -> u32

Source§

impl Simple16 for u16

Source§

fn check(_data: &[Self]) -> Result<(), ValueOutOfRange>

Source§

fn as_(self) -> u32

Source§

impl Simple16 for u32

Source§

fn check(data: &[Self]) -> Result<(), ValueOutOfRange>

Source§

fn as_(self) -> u32

Source§

impl Simple16 for u64

Source§

fn check(data: &[Self]) -> Result<(), ValueOutOfRange>

Source§

fn as_(self) -> u32

Implementors§