pub struct Sbdf {
pub segment: u16,
pub bus: u8,
pub device: u8,
pub function: u8,
}Expand description
A PCI function identity, including its PCI segment group.
Fields§
§segment: u16§bus: u8§device: u8§function: u8Implementations§
Source§impl Sbdf
impl Sbdf
Sourcepub const fn new(segment: u16, bus: u8, device: u8, function: u8) -> Self
pub const fn new(segment: u16, bus: u8, device: u8, function: u8) -> Self
Build a new segment-qualified PCI identity.
Sourcepub const fn from_pci(bus: u8, device: u8, function: u8) -> Self
pub const fn from_pci(bus: u8, device: u8, function: u8) -> Self
Identity of a device seen on segment 0 (the common case).
Sourcepub const fn to_u32(self) -> u32
pub const fn to_u32(self) -> u32
Packed 32-bit representation: segment:16 | bus:8 | dev:5 | fn:3.
Sourcepub const fn from_u32(raw: u32) -> Self
pub const fn from_u32(raw: u32) -> Self
Unpack a value previously produced by Sbdf::to_u32.
Trait Implementations§
impl Copy for Sbdf
impl Eq for Sbdf
Source§impl Ord for Sbdf
impl Ord for Sbdf
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
Source§impl PartialOrd for Sbdf
impl PartialOrd for Sbdf
impl StructuralPartialEq for Sbdf
Auto Trait Implementations§
impl Forget for Sbdf
impl Freeze for Sbdf
impl Move for Sbdf
impl RefUnwindSafe for Sbdf
impl Send for Sbdf
impl Sync for Sbdf
impl Unpin for Sbdf
impl UnsafeUnpin for Sbdf
impl UnwindSafe for Sbdf
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreimpl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
§impl<T> ToCompactString for Twhere
T: Display,
impl<T> ToCompactString for Twhere
T: Display,
§fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
Fallible version of [
ToCompactString::to_compact_string()] Read more§fn to_compact_string(&self) -> CompactString
fn to_compact_string(&self) -> CompactString
Converts the given value to a [
CompactString]. Read more