SubFeatureRef

Struct SubFeatureRef 

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

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

Implementations§

Source§

impl<'sensors> SubFeatureRef<'sensors>

Source

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

Returns a shared reference to the raw data structure sensors_subfeature.

Source

pub fn feature(self) -> FeatureRef<'sensors>

Return the feature to which this sub-feature belongs.

Source

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

Return the name of this sub-feature, if available and valid UTF-8.

This returns None if no name is available, and returns Some(Err(_)) if the available name is not valid UTF-8.

Source

pub fn number(self) -> c_int

Return the number of this sub-feature.

Source

pub fn mapping(self) -> c_int

Return the number of a main feature this sub-feature belongs to.

Source

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

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

Source

pub fn flags(self) -> Option<Flags>

Return the flags of this sub-feature, if it is valid Flags.

Source

pub fn value(self) -> Result<Value>

Return the value reported by this sub-feature, e.g., sensor.

Source

pub fn set_value(self, new_value: &Value) -> Result<()>

Set the value associated with this sub-feature, e.g., actuator.

Source

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

Return the raw name of this sub-feature, if available.

Source

pub fn raw_kind(self) -> c_uint

Return the raw type of this sub-feature, which is one of SENSORS_SUBFEATURE_*, e.g., SENSORS_SUBFEATURE_TEMP_INPUT.

Source

pub fn raw_flags(self) -> c_uint

Return the raw flags of this sub-feature, which is a combination of SENSORS_MODE_R, SENSORS_MODE_W and SENSORS_COMPUTE_MAPPING.

Source

pub fn raw_value(self) -> Result<f64>

Return the raw value reported by this sub-feature, e.g., sensor.

See: sensors_get_value.

Source

pub fn set_raw_value(self, new_value: f64) -> Result<()>

Set the raw value associated with this sub-feature, e.g., actuator.

See: sensors_set_value.

Trait Implementations§

Source§

impl<'sensors> Clone for SubFeatureRef<'sensors>

Source§

fn clone(&self) -> SubFeatureRef<'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 SubFeatureRef<'sensors>

Source§

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

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

impl Display for SubFeatureRef<'_>

Source§

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

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

impl PartialEq for SubFeatureRef<'_>

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 SubFeatureRef<'sensors>

Source§

impl<'sensors> Eq for SubFeatureRef<'sensors>

Auto Trait Implementations§

§

impl<'sensors> Freeze for SubFeatureRef<'sensors>

§

impl<'sensors> RefUnwindSafe for SubFeatureRef<'sensors>

§

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

§

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

§

impl<'sensors> Unpin for SubFeatureRef<'sensors>

§

impl<'sensors> UnwindSafe for SubFeatureRef<'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.