EntityPath

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

Source§

fn attribute<A, T, E>(&self, attr: A) -> Result<T, EitherErr2<Error, E>>
where A: SysAttribute, 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) -> bool
where A: AsRef<Path>,

Returns true when the entity has the attribute
Source§

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

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