GenericDeviceLocator

Struct GenericDeviceLocator 

Source
pub struct GenericDeviceLocator {
    pub record_key: GenericDeviceRecordKey,
    pub address_span: u8,
    pub device_type: u8,
    pub device_type_modifier: u8,
    pub entity_id: u8,
    pub entity_instance: u8,
    pub oem_reserved: u8,
    pub id_string: SensorId,
}
Expand description

Generic Device Locator Record (SDR Type 10h).

This record is used to store the location and type information for devices on the IPMB or management controller private busses that are neither IPMI FRU devices nor IPMI management controllers.

Reference: IPMI 2.0 Specification, Section 43.7 and Table 43-6

Fields§

§record_key: GenericDeviceRecordKey

Record key data.

§address_span: u8

Address span (number of addresses device occupies - 1).

§device_type: u8

Device Type code per IPMI Device Type Codes table.

Reference: IPMI 2.0 Specification, Table 43-12 “Device Type Codes”

§device_type_modifier: u8

Device Type Modifier.

Reference: IPMI 2.0 Specification, Table 43-6

§entity_id: u8

Entity ID for the device.

Reference: IPMI 2.0 Specification, Table 43-13 “Entity ID Codes”

§entity_instance: u8

Entity Instance.

Note: The IPMI spec only labels this as “Entity Instance” (Table 43-6) without the sensor SDR bit layout, so we keep it as a raw u8.

§oem_reserved: u8

OEM reserved field.

§id_string: SensorId

Device ID string.

Implementations§

Source§

impl GenericDeviceLocator

Source

pub fn parse(record_data: &[u8]) -> Result<GenericDeviceLocator, ParseError>

Parse a Generic Device Locator Record from raw SDR record data.

The record data layout is defined in IPMI 2.0 Specification, Table 43-6. Offsets below are relative to the record data payload (table bytes 6+).

OffsetField
0Device Access Address [7:1], [0] reserved
1Device Slave Address, channel ms-bit in [0]
2[7:5] Channel Number (ls-3 bits), [4:3] Access LUN, [2:0] Private Bus ID
3[7:3] reserved, [2:0] Address Span
4Reserved
5Device Type (Table 43-12)
6Device Type Modifier (Table 43-12)
7Entity ID (Table 43-13)
8Entity Instance
9OEM
10Device ID String Type/Length
11+Device ID String bytes
Source

pub fn id_string(&self) -> &SensorId

Trait Implementations§

Source§

impl Clone for GenericDeviceLocator

Source§

fn clone(&self) -> GenericDeviceLocator

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

impl Debug for GenericDeviceLocator

Source§

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

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

impl IdentifiableSensor for GenericDeviceLocator

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.

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

Source§

type Output = T

Should always be Self
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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V