Enum sysfuss::EntityPath

source ·
pub enum EntityPath {
    HwMon(HwMonPath),
    PowerSupply(PowerSupplyPath),
    Generic(BasicEntityPath),
    Custom(Arc<Box<dyn SysEntity>>),
}
Expand description

sysfs class entity implementors

Variants§

§

HwMon(HwMonPath)

hwmon

§

PowerSupply(PowerSupplyPath)

power_supply

§

Generic(BasicEntityPath)

Generic

§

Custom(Arc<Box<dyn SysEntity>>)

Miscellaneous

Trait Implementations§

source§

impl AsRef<Path> for EntityPath

source§

fn as_ref(&self) -> &Path

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl SysEntity for EntityPath

source§

fn to_entity_path(self) -> Self

Convert specialized entity into general entity path container
source§

fn name(&self) -> IoResult<String>

Get the entity’s name
source§

fn root(&self) -> Option<SysPath>

Try to get the entity’s root sysfs dir (probably /)

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> SysEntityRawExt for Xwhere X: SysEntity,

source§

fn attribute<A, T, E>(&self, attr: A) -> Result<T, EitherErr2<Error, E>>where A: SysAttribute + Eq, T: FromStr<Err = E>,

Get an attribute on the entity
source§

fn attribute_str<A>(&self, attr: A) -> Result<String, Error>where A: AsRef<Path>,

Get an attribute by filename in the entity’s directory
source§

fn exists_str<A>(&self, attr: A) -> boolwhere A: AsRef<Path>,

Returns true when the entity has the attribute
source§

fn exists<A>(&self, attr: A) -> boolwhere A: SysAttribute,

Returns true when the entity has the attribute
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.