Skip to main content

ByteEnabledDwordRead

Struct ByteEnabledDwordRead 

Source
pub struct ByteEnabledDwordRead<'a> { /* private fields */ }
Expand description

A DWORD value with byte enables for PCI configuration space read.

Implementations§

Source§

impl<'a> ByteEnabledDwordRead<'a>

Source

pub const fn new(value: &'a mut u32, byte_enable: PciConfigByteEnable) -> Self

Create a byte-enabled DWORD value.

Source

pub const fn with_all_bytes_enabled(value: &'a mut u32) -> Self

Create a full-DWORD value with all byte lanes enabled.

Source

pub const fn byte_enable(&self) -> PciConfigByteEnable

Retrieve the underlying byte enable.

Source

pub fn fill_intercept_buffer(self, buffer: &mut [u8])

Fill the intercept buffer with the enabled byte lanes of the DWORD.

Source

pub fn into_valid_byte_slice(self) -> &'a mut [u8]

Retrieve a mutable slice of the enabled byte lanes of the DWORD.

Source

pub const fn valid_mask(&self) -> u32

Get the mask of valid bytes.

Source

pub fn set(&mut self, value: u32)

Update the value of the DWORD, honoring byte enables.

Source

pub fn set_low_high(&mut self, low: u16, high: u16)

Update the value of the DWORD, honoring byte enables.

Source

pub fn set_bytes(&mut self, byte0: u8, byte1: u8, byte2: u8, byte3: u8)

Update the value of the DWORD, honoring byte enables.

Source

pub const fn extract(&self) -> u32

Keep only enabled byte lanes from this value.

Source

pub const fn extract_low(self) -> u16

Keep only enabled byte lanes from the low WORD this value.

Source

pub const fn extract_high(self) -> u16

Keep only enabled byte lanes from the high WORD this value.

Source

pub fn reborrow(&mut self) -> ByteEnabledDwordRead<'_>

Reborrow the underlying value.

Source

pub fn restrict( &mut self, byte_enable: PciConfigByteEnable, ) -> Option<ByteEnabledDwordRead<'_>>

Restrict the read to only the provided bytes.

Source

pub fn exclude( &mut self, byte_enable: PciConfigByteEnable, ) -> Option<ByteEnabledDwordRead<'_>>

Exclude the provided bytes from the read.

Trait Implementations§

Source§

impl<'a> Debug for ByteEnabledDwordRead<'a>

Source§

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

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

impl<'a> InspectMut for ByteEnabledDwordRead<'a>

Source§

fn inspect_mut(&mut self, req: Request<'_>)

Inspects the object.

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

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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, 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.
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more