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>
impl<'sensors> FeatureRef<'sensors>
Sourcepub fn raw_ref(self) -> &'sensors sensors_feature
pub fn raw_ref(self) -> &'sensors sensors_feature
Returns a shared reference to the raw data structure sensors_feature.
Sourcepub fn name(self) -> Option<Result<&'sensors str>>
pub fn name(self) -> Option<Result<&'sensors str>>
Return the name of this feature, if it is valid UTF-8.
Sourcepub fn sub_feature_by_kind(self, kind: Kind) -> Result<SubFeatureRef<'sensors>>
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.
Sourcepub fn sub_feature_iter(self) -> Iter<'sensors> ⓘ
pub fn sub_feature_iter(self) -> Iter<'sensors> ⓘ
Return an iterator which yields all sub-features belonging to this feature.
Sourcepub fn raw_name(self) -> Option<&'sensors CStr>
pub fn raw_name(self) -> Option<&'sensors CStr>
Return the raw name of this feature, if available.
Sourcepub fn raw_label(self) -> Result<CString>
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.
Sourcepub fn raw_kind(self) -> c_uint
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.
Sourcepub fn sub_feature_by_raw_kind(
self,
kind: c_uint,
) -> Result<SubFeatureRef<'sensors>>
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>
impl<'sensors> Clone for FeatureRef<'sensors>
Source§fn clone(&self) -> FeatureRef<'sensors>
fn clone(&self) -> FeatureRef<'sensors>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more