pub struct DeviceLocation {
pub bus: u8,
pub tree_positions: Vec<u8>,
pub number: u8,
}Expand description
location_id String from system_profiler is “LocationReg / DeviceNo”
The LocationReg has the tree structure (0xbbdddddd):
0x – always bb – bus number in hexadecimal dddddd – up to six levels for the tree, each digit represents its position on that level
Fields§
§bus: u8Number of bus attached too
tree_positions: Vec<u8>Length is depth in tree and position at each branch, empty is bus controller
number: u8Device number on bus, generally not related to tree
Trait Implementations§
Source§impl Clone for DeviceLocation
impl Clone for DeviceLocation
Source§fn clone(&self) -> DeviceLocation
fn clone(&self) -> DeviceLocation
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for DeviceLocation
impl Debug for DeviceLocation
Source§impl Default for DeviceLocation
impl Default for DeviceLocation
Source§fn default() -> DeviceLocation
fn default() -> DeviceLocation
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for DeviceLocation
impl<'de> Deserialize<'de> for DeviceLocation
Source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl From<DeviceLocation> for PortPath
impl From<DeviceLocation> for PortPath
Source§fn from(location: DeviceLocation) -> Self
fn from(location: DeviceLocation) -> Self
Converts to this type from the input type.
Source§impl FromStr for DeviceLocation
Converts from macOS system_profiler string to DeviceLocation
impl FromStr for DeviceLocation
Converts from macOS system_profiler string to DeviceLocation
Source§impl PartialEq for DeviceLocation
impl PartialEq for DeviceLocation
Source§impl Serialize for DeviceLocation
impl Serialize for DeviceLocation
impl Eq for DeviceLocation
impl StructuralPartialEq for DeviceLocation
Auto Trait Implementations§
impl Freeze for DeviceLocation
impl RefUnwindSafe for DeviceLocation
impl Send for DeviceLocation
impl Sync for DeviceLocation
impl Unpin for DeviceLocation
impl UnsafeUnpin for DeviceLocation
impl UnwindSafe for DeviceLocation
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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 more