Struct sysfuss::HwMonAttribute

source ·
pub struct HwMonAttribute { /* private fields */ }
Expand description

Attribute representation. Attribute files are usually in the format <type><number>_<item>.

Implementations§

source§

impl HwMonAttribute

source

pub const fn name() -> Self

name attribute

source

pub const fn new( ty: HwMonAttributeType, number: u64, item: HwMonAttributeItem ) -> Self

Custom attribute in standard format

source

pub const fn uevent() -> Self

uevent attribute

source

pub const fn custom(attr: &'static str) -> Self

Custom entity attribute

Trait Implementations§

source§

impl Clone for HwMonAttribute

source§

fn clone(&self) -> HwMonAttribute

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<HwMonAttribute> for HwMonAttribute

source§

fn eq(&self, other: &HwMonAttribute) -> 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 HwMonAttribute

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<HwMonAttribute> for HwMonPath

source§

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

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 HwMonAttribute

source§

impl Eq for HwMonAttribute

source§

impl StructuralEq for HwMonAttribute

source§

impl StructuralPartialEq for HwMonAttribute

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.