FeatureRef

Struct FeatureRef 

Source
pub struct FeatureRef<'sensors> { /* private fields */ }
Expand description

Shared reference to a feature of some Kind (e.g., temperature), provided by a [Chip].

Implementations§

Source§

impl<'sensors> FeatureRef<'sensors>

Source

pub fn raw_ref(self) -> &'sensors sensors_feature

Returns a shared reference to the raw data structure sensors_feature.

Source

pub fn chip(self) -> ChipRef<'sensors>

Return the chip controlling this feature.

Source

pub fn name(self) -> Option<Result<&'sensors str>>

Return the name of this feature, if it is valid UTF-8.

Source

pub fn label(self) -> Result<String>

Return the label of this feature, if it is valid UTF-8.

Source

pub fn number(self) -> c_int

Return the number of this feature.

Source

pub fn kind(self) -> Option<Kind>

Return the type of this feature, if it is a valid Kind.

Source

pub fn sub_feature_by_kind(self, kind: Kind) -> Result<SubFeatureRef<'sensors>>

Return the sub-feature of the given type for a given main feature, if it exists, or an error otherwise.

Source

pub fn sub_feature_iter(self) -> Iter<'sensors>

Return an iterator which yields all sub-features belonging to this feature.

Source

pub fn raw_name(self) -> Option<&'sensors CStr>

Return the raw name of this feature, if available.

Source

pub fn raw_label(self) -> Result<CString>

Return the raw label of this feature.

If no label exists for this feature, its name is returned.

See: sensors_get_label.

Source

pub fn raw_kind(self) -> c_uint

Return the raw type of this feature, which is one of SENSORS_FEATURE_*, e.g., SENSORS_FEATURE_TEMP.

Source

pub fn sub_feature_by_raw_kind( self, kind: c_uint, ) -> Result<SubFeatureRef<'sensors>>

Return the sub-feature of the given type for a given main feature, if it exists, or an error otherwise.

kind is one of SENSORS_SUBFEATURE_*.

See: sensors_get_subfeature.

Trait Implementations§

Source§

impl<'sensors> Clone for FeatureRef<'sensors>

Source§

fn clone(&self) -> FeatureRef<'sensors>

Returns a duplicate 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<'sensors> Debug for FeatureRef<'sensors>

Source§

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

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

impl Display for FeatureRef<'_>

Source§

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

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

impl PartialEq for FeatureRef<'_>

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<'sensors> Copy for FeatureRef<'sensors>

Source§

impl<'sensors> Eq for FeatureRef<'sensors>

Auto Trait Implementations§

§

impl<'sensors> Freeze for FeatureRef<'sensors>

§

impl<'sensors> RefUnwindSafe for FeatureRef<'sensors>

§

impl<'sensors> !Send for FeatureRef<'sensors>

§

impl<'sensors> !Sync for FeatureRef<'sensors>

§

impl<'sensors> Unpin for FeatureRef<'sensors>

§

impl<'sensors> UnwindSafe for FeatureRef<'sensors>

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

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> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
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.