Skip to main content

ZerocopyWord

Trait ZerocopyWord 

Source
pub trait ZerocopyWord: ZerocopyWord + Copy {
    // Required method
    fn read_as_usize(self) -> Option<usize>;
}
Expand description

Borrowed offset or value word usable by offset-integrity primitives.

Sealed: native unsigned integers and little-endian storage words opt in via the in-tree macros below. External crates cannot satisfy this trait.

§Performance

Reading a word is expected to be O(1).

Required Methods§

Source

fn read_as_usize(self) -> Option<usize>

Reads this word’s value as usize, or returns None when the value does not fit in usize on the current target.

§Performance

This method is O(1).

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl ZerocopyWord for U16<LE>

Source§

impl ZerocopyWord for U32<LE>

Source§

impl ZerocopyWord for U64<LE>

Source§

impl ZerocopyWord for u16

Source§

impl ZerocopyWord for u32

Source§

impl ZerocopyWord for u64

Source§

impl ZerocopyWord for usize

Implementors§