Struct driver_virtio::pci::Command
pub struct Command { /* private fields */ }Expand description
The command register in PCI configuration space.
Implementations§
§impl Command
impl Command
pub const MEMORY_SPACE: Command = Self{ bits: 1 << 1,}
pub const MEMORY_SPACE: Command = Self{ bits: 1 << 1,}
The device can respond to Memory Space accesses.
pub const BUS_MASTER: Command = Self{ bits: 1 << 2,}
pub const BUS_MASTER: Command = Self{ bits: 1 << 2,}
The device can behave as a bus master.
pub const SPECIAL_CYCLES: Command = Self{ bits: 1 << 3,}
pub const SPECIAL_CYCLES: Command = Self{ bits: 1 << 3,}
The device can monitor Special Cycle operations.
pub const MEMORY_WRITE_AND_INVALIDATE_ENABLE: Command = Self{ bits: 1 << 4,}
pub const MEMORY_WRITE_AND_INVALIDATE_ENABLE: Command = Self{ bits: 1 << 4,}
The device can generate the Memory Write and Invalidate command.
pub const VGA_PALETTE_SNOOP: Command = Self{ bits: 1 << 5,}
pub const VGA_PALETTE_SNOOP: Command = Self{ bits: 1 << 5,}
The device will snoop palette register data.
pub const PARITY_ERROR_RESPONSE: Command = Self{ bits: 1 << 6,}
pub const PARITY_ERROR_RESPONSE: Command = Self{ bits: 1 << 6,}
The device should take its normal action when a parity error is detected.
pub const SERR_ENABLE: Command = Self{ bits: 1 << 8,}
pub const SERR_ENABLE: Command = Self{ bits: 1 << 8,}
The SERR# driver is enabled.
pub const FAST_BACK_TO_BACK_ENABLE: Command = Self{ bits: 1 << 9,}
pub const FAST_BACK_TO_BACK_ENABLE: Command = Self{ bits: 1 << 9,}
The device is allowed to generate fast back-to-back transactions.
pub const INTERRUPT_DISABLE: Command = Self{ bits: 1 << 10,}
pub const INTERRUPT_DISABLE: Command = Self{ bits: 1 << 10,}
Assertion of the device’s INTx# signal is disabled.
pub const fn from_bits(bits: u16) -> Option<Command>
pub const fn from_bits(bits: u16) -> Option<Command>
Convert from underlying bit representation, unless that representation contains bits that do not correspond to a flag.
pub const fn from_bits_truncate(bits: u16) -> Command
pub const fn from_bits_truncate(bits: u16) -> Command
Convert from underlying bit representation, dropping any bits that do not correspond to flags.
pub const unsafe fn from_bits_unchecked(bits: u16) -> Command
pub const unsafe fn from_bits_unchecked(bits: u16) -> Command
Convert from underlying bit representation, preserving all bits (even those not corresponding to a defined flag).
Safety
The caller of the bitflags! macro can chose to allow or
disallow extra bits for their bitflags type.
The caller of from_bits_unchecked() has to ensure that
all bits correspond to a defined flag or that extra bits
are valid for this bitflags type.
pub const fn intersects(&self, other: Command) -> bool
pub const fn intersects(&self, other: Command) -> bool
Returns true if there are flags common to both self and other.
pub const fn contains(&self, other: Command) -> bool
pub const fn contains(&self, other: Command) -> bool
Returns true if all of the flags in other are contained within self.
pub fn set(&mut self, other: Command, value: bool)
pub fn set(&mut self, other: Command, value: bool)
Inserts or removes the specified flags depending on the passed value.
pub const fn intersection(self, other: Command) -> Command
pub const fn intersection(self, other: Command) -> Command
Returns the intersection between the flags in self and
other.
Specifically, the returned set contains only the flags which are
present in both self and other.
This is equivalent to using the & operator (e.g.
ops::BitAnd), as in flags & other.
pub const fn union(self, other: Command) -> Command
pub const fn union(self, other: Command) -> Command
Returns the union of between the flags in self and other.
Specifically, the returned set contains all flags which are
present in either self or other, including any which are
present in both (see Self::symmetric_difference if that
is undesirable).
This is equivalent to using the | operator (e.g.
ops::BitOr), as in flags | other.
pub const fn difference(self, other: Command) -> Command
pub const fn difference(self, other: Command) -> Command
Returns the difference between the flags in self and other.
Specifically, the returned set contains all flags present in
self, except for the ones present in other.
It is also conceptually equivalent to the “bit-clear” operation:
flags & !other (and this syntax is also supported).
This is equivalent to using the - operator (e.g.
ops::Sub), as in flags - other.
pub const fn symmetric_difference(self, other: Command) -> Command
pub const fn symmetric_difference(self, other: Command) -> Command
Returns the symmetric difference between the flags
in self and other.
Specifically, the returned set contains the flags present which
are present in self or other, but that are not present in
both. Equivalently, it contains the flags present in exactly
one of the sets self and other.
This is equivalent to using the ^ operator (e.g.
ops::BitXor), as in flags ^ other.
pub const fn complement(self) -> Command
pub const fn complement(self) -> Command
Returns the complement of this set of flags.
Specifically, the returned set contains all the flags which are
not set in self, but which are allowed for this type.
Alternatively, it can be thought of as the set difference
between Self::all() and self (e.g. Self::all() - self)
This is equivalent to using the ! operator (e.g.
ops::Not), as in !flags.
Trait Implementations§
§impl BitAndAssign<Command> for Command
impl BitAndAssign<Command> for Command
§fn bitand_assign(&mut self, other: Command)
fn bitand_assign(&mut self, other: Command)
Disables all flags disabled in the set.
§impl BitOrAssign<Command> for Command
impl BitOrAssign<Command> for Command
§fn bitor_assign(&mut self, other: Command)
fn bitor_assign(&mut self, other: Command)
Adds the set of flags.
§impl BitXorAssign<Command> for Command
impl BitXorAssign<Command> for Command
§fn bitxor_assign(&mut self, other: Command)
fn bitxor_assign(&mut self, other: Command)
Toggles the set of flags.
§impl Extend<Command> for Command
impl Extend<Command> for Command
§fn extend<T>(&mut self, iterator: T)where
T: IntoIterator<Item = Command>,
fn extend<T>(&mut self, iterator: T)where T: IntoIterator<Item = Command>,
source§fn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
extend_one)source§fn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
extend_one)§impl FromIterator<Command> for Command
impl FromIterator<Command> for Command
§impl Ord for Command
impl Ord for Command
§impl PartialOrd<Command> for Command
impl PartialOrd<Command> for Command
§fn partial_cmp(&self, other: &Command) -> Option<Ordering>
fn partial_cmp(&self, other: &Command) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self and other) and is used by the <=
operator. Read more§impl SubAssign<Command> for Command
impl SubAssign<Command> for Command
§fn sub_assign(&mut self, other: Command)
fn sub_assign(&mut self, other: Command)
Disables all flags enabled in the set.