Struct SMBiosPortableBattery

Source
pub struct SMBiosPortableBattery<'a> { /* private fields */ }
Expand description

§Portable Battery (Type 22)

This structure describes the attributes of the portable battery or batteries for the system. The structure contains the static attributes for the group. Each structure describes a single battery pack’s attributes.

Compliant with: DMTF SMBIOS Reference Specification 3.4.0 (DSP0134) Document Date: 2020-07-17

Implementations§

Source§

impl<'a> SMBiosPortableBattery<'a>

Source

pub fn location(&self) -> SMBiosString

Identifies the location of the battery

Source

pub fn manufacturer(&self) -> SMBiosString

Names the company that manufactured the battery

Source

pub fn manufacture_date(&self) -> SMBiosString

The date on which the battery was manufactured.

Version 2.2+ implementations that use a Smart Battery set this field to 0 (no string) to indicate that the SBDS Manufacture Date field contains the information.

Source

pub fn serial_number(&self) -> SMBiosString

The serial number for the battery

Version 2.2+ implementations that use a Smart Battery set this field to 0 (no string) to indicate that the SBDS Serial Number field contains the information.

Source

pub fn device_name(&self) -> SMBiosString

Names the battery device

EXAMPLE: “DR-36”

Source

pub fn device_chemistry(&self) -> Option<PortableBatteryDeviceChemistryData>

Identifies the battery chemistry

Version 2.2+ implementations that use a Smart Battery set this field to 02h (Unknown) to indicate that the SBDS Device Chemistry field contains the information.

Source

pub fn design_capacity(&self) -> Option<PortableBatteryDesignCapacity>

Design capacity of the battery in mWatt-hours

If the value is unknown, the field contains 0.

For version 2.2+ implementations, this value is multiplied by the ‘design_capacity_multiplier’ to produce the actual value.

Source

pub fn design_voltage(&self) -> Option<PortableBatteryDesignVoltage>

Design voltage of the battery in mVolts

If the value is unknown, the field contains 0.

Source

pub fn sbds_version_number(&self) -> SMBiosString

Contains the Smart Battery Data Specification version number supported by this battery

If the battery does not support the function, no string is supplied.

Source

pub fn maximum_error_in_battery_data(&self) -> Option<u8>

Maximum error (as a percentage in the range 0 to 100) in the Watt-hour data reported by the battery, indicating an upper bound on how much additional energy the battery might have above the energy it reports having

If the value is unknown, the field contains FFh.

Source

pub fn sbds_serial_number(&self) -> Option<u16>

16-bit value that identifies the battery’s serial number

This value, when combined with the Manufacturer, Device Name, and Manufacture Date, uniquely identifies the battery. The Serial Number field must be set to 0 (no string) for this field to be valid.

Source

pub fn sbds_manufacture_date(&self) -> Option<u16>

Date the cell pack was manufactured, in packed format

Source

pub fn sbds_device_chemistry(&self) -> SMBiosString

Number of the string that identifies the battery chemistry (for example, “PbAc”) The Device Chemistry field must be set to 02h (Unknown) for this field to be valid.

Source

pub fn design_capacity_multiplier(&self) -> Option<u8>

Multiplication factor of the Design Capacity value, which assures that the mWatt hours value does not overflow for SBDS implementations

The multiplier default is 1, SBDS implementations use the value 10 to correspond to the data as returned from the SBDS Function 18h.

Source

pub fn oem_specific(&self) -> Option<u32>

Contains OEM- or BIOS vendor-specific information

Trait Implementations§

Source§

impl Debug for SMBiosPortableBattery<'_>

Source§

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

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

impl<'a> SMBiosStruct<'a> for SMBiosPortableBattery<'a>

Source§

const STRUCT_TYPE: u8 = 22u8

The SMBIOS structure type Read more
Source§

fn new(parts: &'a UndefinedStruct) -> Self

Creates a new instance of the implementing SMBIOS type
Source§

fn parts(&self) -> &'a UndefinedStruct

Contains the standard parts/sections of the implementing SMBIOS type.
Source§

impl Serialize for SMBiosPortableBattery<'_>

Source§

fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where S: Serializer,

Serialize this value into the given Serde serializer. Read more

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