Skip to main content

Vsew

Enum Vsew 

Source
#[repr(u8)]
pub enum Vsew { E8 = 0, E16 = 1, E32 = 2, E64 = 3, }
Expand description

Selected element width (SEW).

Encoded in vtype[5:3] as vsew. SEW = 8 * 2^vsew.

Variants§

§

E8 = 0

SEW = 8 bits (vsew = 0b000)

§

E16 = 1

SEW = 16 bits (vsew = 0b001)

§

E32 = 2

SEW = 32 bits (vsew = 0b010)

§

E64 = 3

SEW = 64 bits (vsew = 0b011)

Implementations§

Source§

impl Vsew

Source

pub const fn from_bits(bits: u8) -> Option<Self>

Decode from the 3-bit vsew field. Returns None for reserved encodings.

Source

pub const fn to_bits(self) -> u8

Encode to the 3-bit vsew field

Source

pub const fn bits(self) -> u8

Element width in bits

Source

pub const fn bytes(self) -> u8

Element width in bytes

Source

pub const fn as_eew(self) -> Eew

Convert to the corresponding Eew variant.

Every valid Vsew value has a directly corresponding Eew value because both enumerate the same set of widths (8/16/32/64 bits). The conversion is always successful.

Trait Implementations§

Source§

impl Clone for Vsew

Source§

fn clone(&self) -> Vsew

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Vsew

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for Vsew

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl PartialEq for Vsew

Source§

fn eq(&self, other: &Vsew) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Copy for Vsew

Source§

impl Eq for Vsew

Source§

impl StructuralPartialEq for Vsew

Auto Trait Implementations§

§

impl Freeze for Vsew

§

impl RefUnwindSafe for Vsew

§

impl Send for Vsew

§

impl Sync for Vsew

§

impl Unpin for Vsew

§

impl UnsafeUnpin for Vsew

§

impl UnwindSafe for Vsew

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.