Skip to main content

Scalar

Trait Scalar 

Source
pub trait Scalar: Copy + Sized {
    const WIDTH: usize;

    // Required methods
    fn from_words(words: &[u32]) -> Option<Self>;
    fn write_words(self, words: &mut [u32]) -> Option<()>;
}
Expand description

A fixed-width scalar that can be read from and written to little-endian words.

Required Associated Constants§

Source

const WIDTH: usize

Encoded width in u32 words.

Required Methods§

Source

fn from_words(words: &[u32]) -> Option<Self>

Decodes from exactly Self::WIDTH words.

Source

fn write_words(self, words: &mut [u32]) -> Option<()>

Encodes into exactly Self::WIDTH words.

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 Scalar for bool

Source§

const WIDTH: usize = 1

Source§

fn from_words(words: &[u32]) -> Option<Self>

Source§

fn write_words(self, words: &mut [u32]) -> Option<()>

Source§

impl Scalar for f32

Source§

const WIDTH: usize

Source§

fn from_words(words: &[u32]) -> Option<Self>

Source§

fn write_words(self, words: &mut [u32]) -> Option<()>

Source§

impl Scalar for f64

Source§

const WIDTH: usize

Source§

fn from_words(words: &[u32]) -> Option<Self>

Source§

fn write_words(self, words: &mut [u32]) -> Option<()>

Source§

impl Scalar for i32

Source§

const WIDTH: usize

Source§

fn from_words(words: &[u32]) -> Option<Self>

Source§

fn write_words(self, words: &mut [u32]) -> Option<()>

Source§

impl Scalar for i64

Source§

const WIDTH: usize

Source§

fn from_words(words: &[u32]) -> Option<Self>

Source§

fn write_words(self, words: &mut [u32]) -> Option<()>

Source§

impl Scalar for u32

Source§

const WIDTH: usize

Source§

fn from_words(words: &[u32]) -> Option<Self>

Source§

fn write_words(self, words: &mut [u32]) -> Option<()>

Source§

impl Scalar for u64

Source§

const WIDTH: usize

Source§

fn from_words(words: &[u32]) -> Option<Self>

Source§

fn write_words(self, words: &mut [u32]) -> Option<()>

Implementors§