Skip to main content

ConfigurationField

Struct ConfigurationField 

Source
pub struct ConfigurationField { /* private fields */ }
Expand description

Configuration Field (CF) - EN 13757-7:2018 Clause 7.5.8, Table 18

The configuration field consists of two bytes containing information about the applied Security mode. The Security mode defines:

  • applied set of security mechanisms
  • content of other bits in the configuration field
  • presence, length and content of configuration field extension (CFE)
  • number, length and content of optional TPL-header/trailer fields

§Bit Layout (Table 18)

  • Bits 15-13: Security mode specific (X)
  • Bits 12-8: Security mode bits (M) - 5 bits defining the security mode
  • Bits 7-0: Security mode specific (X)

The decoding of bits marked “X” depends on the selected Security mode.

Implementations§

Source§

impl ConfigurationField

Source

pub const fn from_bytes(lsb: u8, msb: u8) -> Self

Create a Configuration Field from two bytes

§Arguments
  • lsb - Lower byte (bits 7-0)
  • msb - Upper byte (bits 15-8)
Source

pub const fn raw(&self) -> u16

Get the raw 16-bit value

Source

pub const fn security_mode(&self) -> SecurityMode

Get the Security mode (bits 12-8, 5 bits)

The Security mode defines the applied set of security mechanisms. See EN 13757-7:2018 Table 19 for Security mode definitions.

Source

pub const fn mode_specific_lower(&self) -> u8

Get the lower mode-specific byte (bits 7-0)

The meaning of these bits depends on the selected Security mode.

Source

pub const fn mode_specific_upper(&self) -> u8

Get the upper mode-specific bits (bits 15-13)

The meaning of these bits depends on the selected Security mode.

Trait Implementations§

Source§

impl Clone for ConfigurationField

Source§

fn clone(&self) -> ConfigurationField

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Copy for ConfigurationField

Source§

impl Debug for ConfigurationField

Source§

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

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

impl Eq for ConfigurationField

Source§

impl From<ConfigurationField> for u16

Source§

fn from(cf: ConfigurationField) -> Self

Converts to this type from the input type.
Source§

impl From<u16> for ConfigurationField

Source§

fn from(value: u16) -> Self

Converts to this type from the input type.
Source§

impl Hash for ConfigurationField

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for ConfigurationField

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · 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 StructuralPartialEq for ConfigurationField

Auto Trait Implementations§

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, 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.