Skip to main content

CfmwsWindowRestrictions

Struct CfmwsWindowRestrictions 

pub struct CfmwsWindowRestrictions(/* private fields */);
Expand description

CFMWS window restrictions bitfield.

Re-exported from cxl_spec so existing vm_topology::cxl users remain source-compatible. CFMWS window restrictions bitfield.

Implementations§

§

impl CfmwsWindowRestrictions

pub const fn new() -> CfmwsWindowRestrictions

Creates a new default initialized bitfield.

pub const fn from_bits(bits: u16) -> CfmwsWindowRestrictions

Convert from bits.

pub const fn into_bits(self) -> u16

Convert into bits.

pub const fn device_coherent(&self) -> bool

Bit 0: Device Coherent (HDM-D / HDM-DB when BI is set).

Bits: 0..1

pub const fn with_device_coherent_checked( self, value: bool, ) -> Result<CfmwsWindowRestrictions, ()>

Bit 0: Device Coherent (HDM-D / HDM-DB when BI is set).

Bits: 0..1

pub const fn with_device_coherent(self, value: bool) -> CfmwsWindowRestrictions

Bit 0: Device Coherent (HDM-D / HDM-DB when BI is set).

Bits: 0..1

pub const fn set_device_coherent(&mut self, value: bool)

Bit 0: Device Coherent (HDM-D / HDM-DB when BI is set).

Bits: 0..1

pub const fn set_device_coherent_checked( &mut self, value: bool, ) -> Result<(), ()>

Bit 0: Device Coherent (HDM-D / HDM-DB when BI is set).

Bits: 0..1

pub const fn host_only_coherent(&self) -> bool

Bit 1: Host-only Coherent (HDM-H).

Bits: 1..2

pub const fn with_host_only_coherent_checked( self, value: bool, ) -> Result<CfmwsWindowRestrictions, ()>

Bit 1: Host-only Coherent (HDM-H).

Bits: 1..2

pub const fn with_host_only_coherent( self, value: bool, ) -> CfmwsWindowRestrictions

Bit 1: Host-only Coherent (HDM-H).

Bits: 1..2

pub const fn set_host_only_coherent(&mut self, value: bool)

Bit 1: Host-only Coherent (HDM-H).

Bits: 1..2

pub const fn set_host_only_coherent_checked( &mut self, value: bool, ) -> Result<(), ()>

Bit 1: Host-only Coherent (HDM-H).

Bits: 1..2

pub const fn volatile(&self) -> bool

Bit 2: Window is configured for volatile memory.

Bits: 2..3

pub const fn with_volatile_checked( self, value: bool, ) -> Result<CfmwsWindowRestrictions, ()>

Bit 2: Window is configured for volatile memory.

Bits: 2..3

pub const fn with_volatile(self, value: bool) -> CfmwsWindowRestrictions

Bit 2: Window is configured for volatile memory.

Bits: 2..3

pub const fn set_volatile(&mut self, value: bool)

Bit 2: Window is configured for volatile memory.

Bits: 2..3

pub const fn set_volatile_checked(&mut self, value: bool) -> Result<(), ()>

Bit 2: Window is configured for volatile memory.

Bits: 2..3

pub const fn persistent(&self) -> bool

Bit 3: Window is configured for persistent memory.

Bits: 3..4

pub const fn with_persistent_checked( self, value: bool, ) -> Result<CfmwsWindowRestrictions, ()>

Bit 3: Window is configured for persistent memory.

Bits: 3..4

pub const fn with_persistent(self, value: bool) -> CfmwsWindowRestrictions

Bit 3: Window is configured for persistent memory.

Bits: 3..4

pub const fn set_persistent(&mut self, value: bool)

Bit 3: Window is configured for persistent memory.

Bits: 3..4

pub const fn set_persistent_checked(&mut self, value: bool) -> Result<(), ()>

Bit 3: Window is configured for persistent memory.

Bits: 3..4

pub const fn fixed_device_configuration(&self) -> bool

Bit 4: Fixed Device Configuration.

Bits: 4..5

pub const fn with_fixed_device_configuration_checked( self, value: bool, ) -> Result<CfmwsWindowRestrictions, ()>

Bit 4: Fixed Device Configuration.

Bits: 4..5

pub const fn with_fixed_device_configuration( self, value: bool, ) -> CfmwsWindowRestrictions

Bit 4: Fixed Device Configuration.

Bits: 4..5

pub const fn set_fixed_device_configuration(&mut self, value: bool)

Bit 4: Fixed Device Configuration.

Bits: 4..5

pub const fn set_fixed_device_configuration_checked( &mut self, value: bool, ) -> Result<(), ()>

Bit 4: Fixed Device Configuration.

Bits: 4..5

pub const fn bi(&self) -> bool

Bit 5: Back-Invalidate (BI) enabled.

Bits: 5..6

pub const fn with_bi_checked( self, value: bool, ) -> Result<CfmwsWindowRestrictions, ()>

Bit 5: Back-Invalidate (BI) enabled.

Bits: 5..6

pub const fn with_bi(self, value: bool) -> CfmwsWindowRestrictions

Bit 5: Back-Invalidate (BI) enabled.

Bits: 5..6

pub const fn set_bi(&mut self, value: bool)

Bit 5: Back-Invalidate (BI) enabled.

Bits: 5..6

pub const fn set_bi_checked(&mut self, value: bool) -> Result<(), ()>

Bit 5: Back-Invalidate (BI) enabled.

Bits: 5..6

§

impl CfmwsWindowRestrictions

pub const NONE: CfmwsWindowRestrictions

No restrictions set.

pub const DEVICE_COHERENT: CfmwsWindowRestrictions

Bit 0: Device Coherent (HDM-D / HDM-DB when BI is set).

pub const HOST_ONLY_COHERENT: CfmwsWindowRestrictions

Bit 1: Host-only Coherent (HDM-H).

pub const VOLATILE: CfmwsWindowRestrictions

Bit 2: Window is configured for volatile memory.

pub const PERSISTENT: CfmwsWindowRestrictions

Bit 3: Window is configured for persistent memory.

pub const FIXED_DEVICE_CONFIGURATION: CfmwsWindowRestrictions

Bit 4: Fixed Device Configuration.

pub const BI: CfmwsWindowRestrictions

Bit 5: Back-Invalidate (BI) enabled.

pub const VALID_BITS_MASK: u16

Mask of all currently defined CFMWS window restriction bits.

pub const fn bits(self) -> u16

Returns the raw 16-bit bitmap value.

pub const fn try_from_bits(bits: u16) -> Option<CfmwsWindowRestrictions>

Creates a restrictions value from a raw 16-bit bitmap.

Returns None when any reserved bit (15:6) is set.

pub const fn is_valid_bits(bits: u16) -> bool

Returns true if bits only contains currently defined restriction bits.

pub const fn contains(self, other: CfmwsWindowRestrictions) -> bool

True when all bits in other are present in self.

Trait Implementations§

§

impl BitOr for CfmwsWindowRestrictions

§

type Output = CfmwsWindowRestrictions

The resulting type after applying the | operator.
§

fn bitor( self, rhs: CfmwsWindowRestrictions, ) -> <CfmwsWindowRestrictions as BitOr>::Output

Performs the | operation. Read more
§

impl BitOrAssign for CfmwsWindowRestrictions

§

fn bitor_assign(&mut self, rhs: CfmwsWindowRestrictions)

Performs the |= operation. Read more
§

impl Clone for CfmwsWindowRestrictions

§

fn clone(&self) -> CfmwsWindowRestrictions

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
§

impl Debug for CfmwsWindowRestrictions

§

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

Formats the value using the given formatter. Read more
§

impl Default for CfmwsWindowRestrictions

§

fn default() -> CfmwsWindowRestrictions

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

impl From<u16> for CfmwsWindowRestrictions

§

fn from(v: u16) -> CfmwsWindowRestrictions

Converts to this type from the input type.
§

impl PartialEq for CfmwsWindowRestrictions

§

fn eq(&self, other: &CfmwsWindowRestrictions) -> 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.
§

impl Copy for CfmwsWindowRestrictions

§

impl Eq for CfmwsWindowRestrictions

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.

§

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

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