pub enum PowerSupplyAttribute {
Show 38 variants Manufacturer, ModelName, SerialNumber, Type, CurrentAverage, CurrentMax, CurrentNow, Temperature, TemperatureAlertMax, TemperatureAlertMin, TemperatureMax, TemperatureMin, VoltageMax, VoltageMin, VoltageNow, Capacity, CapacityAlertMax, CapacityAlertMin, CapacityErrorMargin, CapacityLevel, ChargeControlLimit, ChargeControlLimitMax, ChargeControlStartThreshold, ChargeControlEndThreshold, ChargeType, ChargeTermCurrent, ChargeNow, ChargeFull, ChargeFullDesign, Health, PrechargeCurrent, Present, Status, ChargeBehaviour, Technology, VoltageAverage, CycleCount, Custom(&'static str),
}
Expand description

Attribute files in a power supply directory These attributes are taken from https://github.com/torvalds/linux/blob/master/Documentation/ABI/testing/sysfs-class-power

Variants§

§

Manufacturer

Reports the name of the device manufacturer.

§

ModelName

Reports the name of the device model.

§

SerialNumber

Reports the serial number of the device.

§

Type

Describes the main type of the supply.

§

CurrentAverage

Reports an average current reading over a fixed period (uA).

§

CurrentMax

Reports the maximum current the power supply supports (uA).

§

CurrentNow

Reports the instantaneous current of the power supply (uA).

§

Temperature

Reports the temperature reading (dC – 1/10 degree Celcius).

§

TemperatureAlertMax

Maximum temperature where the supply will notify user-space of the event (dC).

§

TemperatureAlertMin

Minimum temperature where the supply will notify user-space of the event (dC).

§

TemperatureMax

Reports the maximum allowed temperature for operation (dC).

§

TemperatureMin

Reports the minimum allowed temperature for operation (dC).

§

VoltageMax

Reports the maximum safe voltage (uV).

§

VoltageMin

Reports the minimum safe voltage (uV).

§

VoltageNow

Reports the instantaneous voltage of the power supply (uV).

§

Capacity

Fine grain representation of the battery capacity (%).

§

CapacityAlertMax

Maximum battery capacity trip-wire value where the supply will notify user-space of the event (%).

§

CapacityAlertMin

Minimum battery capacity trip-wire value where the supply will notify user-space of the event (%).

§

CapacityErrorMargin

This values provides the maximum error margin expected to exist by the fuel gauge in percent (%).

§

CapacityLevel

Coarse representation of battery capacity (“Unknown”, “Critical”, “Low”, “Normal”, “High”, or “Full”).

§

ChargeControlLimit

Maximum allowable charging current (uA).

§

ChargeControlLimitMax

Maximum legal value for the charge_control_limit property (uA).

§

ChargeControlStartThreshold

Represents a battery percentage level, below which charging will begin (%).

§

ChargeControlEndThreshold

Represents a battery percentage level, above which charging will stop (%).

§

ChargeType

Represents the type of charging currently being applied to the battery (“Unknown”, “N/A”, “Trickle”, “Fast”, “Standard”, “Adaptive”, “Custom”, “Long Life”, or “Bypass”).

§

ChargeTermCurrent

Reports the charging current value which is used to determine when the battery is considered full and charging should end (uA).

§

ChargeNow

Reports the instantaneous charge value of the power supply (uA).

§

ChargeFull

Reports the maximum charge value of the power supply (uA).

§

ChargeFullDesign

Reports the maximum rated charge value of the power supply (uA).

§

Health

Reports the health of the battery or battery side of charger functionality ( “Unknown”, “Good”, “Overheat”, “Dead”, “Over voltage”, “Unspecified failure”, “Cold”, “Watchdog timer expire”, “Safety timer expire”, “Over current”, “Calibration required”, “Warm”, “Cool”, “Hot”, or “No battery”).

§

PrechargeCurrent

Reports the charging current applied during pre-charging phase for a battery charge cycle (uA).

§

Present

Reports whether a battery is present or not in the system (0 or 1). If the property does not exist, the battery is considered to be present.

§

Status

Represents the charging status of the battery ( “Unknown”, “Charging”, “Discharging”, “Not charging”, or “Full”).

§

ChargeBehaviour

Represents the charging behaviour (“auto”, “inhibit-charge”, or “force-discharge”).

§

Technology

Describes the battery technology supported by the supply.

§

VoltageAverage

Reports an average voltage over a fixed period (uV).

§

CycleCount

Reports the number of full charge + discharge cycles the battery has undergone.

§

Custom(&'static str)

Custom entity attribute

Trait Implementations§

source§

impl Clone for PowerSupplyAttribute

source§

fn clone(&self) -> PowerSupplyAttribute

Returns a copy 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 PartialEq<PowerSupplyAttribute> for PowerSupplyAttribute

source§

fn eq(&self, other: &PowerSupplyAttribute) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl SysAttribute for PowerSupplyAttribute

source§

fn filename(&self) -> PathBuf

attribute file name
source§

fn path(&self, entity: &dyn SysEntity) -> PathBuf

full path to attribute file
source§

fn exists(&self, entity: &dyn SysEntity) -> bool

returns true if the path to the attribute file exists
source§

fn read_value(&self, entity: &dyn SysEntity) -> IoResult<Vec<u8>>

read attribute value from sysfs
source§

fn write_value(&self, entity: &dyn SysEntity, value: &[u8]) -> IoResult<()>

write attribute value to sysfs
source§

fn readonly(&self, entity: &dyn SysEntity) -> bool

Returns true if the attribute is readonly
source§

impl SysEntityAttributes<PowerSupplyAttribute> for PowerSupplyPath

source§

fn capabilities(&self) -> Vec<PowerSupplyAttribute>

Get attributes available on this entity;
source§

fn read_value(&self, attr: A) -> IoResult<Vec<u8>>

Read entity attribute value
source§

fn write_value(&self, attr: A, value: &[u8]) -> IoResult<()>

Write entity attribute value
source§

impl Copy for PowerSupplyAttribute

source§

impl Eq for PowerSupplyAttribute

source§

impl StructuralEq for PowerSupplyAttribute

source§

impl StructuralPartialEq for PowerSupplyAttribute

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere 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 Twhere 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<X> SysAttributeExt for Xwhere X: SysAttribute + Eq,

source§

fn read_str(&self, entity: &dyn SysEntity) -> IoResult<String>

read attribute as string
source§

fn write_str(&self, entity: &dyn SysEntity, s: &str) -> IoResult<()>

write attribute string value to sysfsfilter_map
source§

fn parse<T: FromStr<Err = E>, E>( &self, entity: &dyn SysEntity ) -> Result<T, EitherErr2<Error, E>>

read and parse the attribute value
source§

impl<T> ToOwned for Twhere T: Clone,

§

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 Twhere U: Into<T>,

§

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 Twhere U: TryFrom<T>,

§

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.