Struct IdCode

Source
pub struct IdCode {
    pub _reserved: ReservedOnes<Bits1>,
    pub manufacturer_id: Integer<u16, Bits11>,
    pub device: Integer<u8, Bits5>,
    pub subfamily: Integer<u8, Bits4>,
    pub family: Integer<u8, Bits7>,
    pub version: Integer<u8, Bits4>,
}

Fields§

§_reserved: ReservedOnes<Bits1>§manufacturer_id: Integer<u16, Bits11>§device: Integer<u8, Bits5>§subfamily: Integer<u8, Bits4>§family: Integer<u8, Bits7>§version: Integer<u8, Bits4>

Implementations§

Source§

impl IdCode

Source

pub fn packed_struct_display_formatter<'a>( &'a self, ) -> PackedStructDisplay<'a, Self, [u8; 4]>

Display formatter for console applications

Trait Implementations§

Source§

impl Clone for IdCode

Source§

fn clone(&self) -> IdCode

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 IdCode

Source§

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

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

impl Default for IdCode

Source§

fn default() -> IdCode

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for IdCode

Source§

fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
where D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Display for IdCode

Source§

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

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

impl FromStr for IdCode

Source§

type Err = Error

The associated error which can be returned from parsing.
Source§

fn from_str(src: &str) -> Result<Self, Self::Err>

Parses a string s to return a value of this type. Read more
Source§

impl LowerHex for IdCode

Source§

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

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

impl PackedStruct<[u8; 4]> for IdCode

Structure that can be packed an unpacked into 4 bytes.

Bit, MSB0NameType
31_reservedReservedOnes < packed_bits :: Bits1 >
20:30manufacturer_idInteger < u16 , packed_bits :: Bits11 >
15:19deviceInteger < u8 , packed_bits :: Bits5 >
11:14subfamilyInteger < u8 , packed_bits :: Bits4 >
4:10familyInteger < u8 , packed_bits :: Bits7 >
0:3versionInteger < u8 , packed_bits :: Bits4 >
Source§

fn pack(&self) -> [u8; 4]

Packs the structure into a byte array.
Source§

fn unpack(src: &[u8; 4]) -> Result<IdCode, PackingError>

Unpacks the structure from a byte array.
Source§

impl PackedStructDebug for IdCode

Source§

impl PackedStructInfo for IdCode

Source§

fn packed_bits() -> usize

Number of bits that this structure occupies when being packed.
Source§

impl PackedStructSlice for IdCode

Source§

fn pack_to_slice(&self, output: &mut [u8]) -> Result<(), PackingError>

Pack the structure into an output buffer.
Source§

fn unpack_from_slice(src: &[u8]) -> Result<Self, PackingError>

Unpack the structure from a buffer.
Source§

fn packed_bytes() -> usize

Number of bytes that this structure demands for packing or unpacking.
Source§

fn pack_to_vec(&self) -> Result<Vec<u8>, PackingError>

Pack the structure into a new byte vector.
Source§

impl PartialEq for IdCode

Source§

fn eq(&self, other: &IdCode) -> 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 Register for IdCodeRegister

Source§

impl Serialize for IdCode

Source§

fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl Copy for IdCode

Source§

impl StructuralPartialEq for IdCode

Auto Trait Implementations§

§

impl Freeze for IdCode

§

impl RefUnwindSafe for IdCode

§

impl Send for IdCode

§

impl Sync for IdCode

§

impl Unpin for IdCode

§

impl UnwindSafe for IdCode

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> FromBytes for T

Source§

fn from_bytes(reader: &mut dyn BufRead) -> Result<T, Error>

Read an instance of this type from the reader. Read more
Source§

impl<T> FromWord for T
where T: PackedStruct<[u8; 4]>,

Source§

fn from_word(word: Word) -> Result<Self, Error>

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> ToBytes for T

Source§

fn to_bytes(&self, writer: &mut dyn Write) -> Result<(), Error>

Write an instance of this type to the writer. Read more
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> ToWord for T
where T: PackedStruct<[u8; 4]>,

Source§

fn to_word(&self) -> Word

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.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,