pub struct Feature { /* private fields */ }Expand description
Data about a single chip feature (or category leader)
Implementations§
Source§impl Feature
impl Feature
pub fn name(&self) -> &str
pub fn number(&self) -> i32
pub fn feature_type(&self) -> &FeatureType
Sourcepub fn get_label(&self) -> Result<String, LibsensorsError>
pub fn get_label(&self) -> Result<String, LibsensorsError>
Look up the label of the feature. If no label exists for this feature, its name is returned itself.
Examples found in repository?
examples/simple.rs (line 14)
5fn main() {
6 let sensors = Sensors::new();
7 for chip in sensors {
8 println!(
9 "{} (on {})",
10 chip.get_name().unwrap(),
11 chip.bus().get_adapter_name().unwrap()
12 );
13 for feature in chip {
14 println!(" - {}", feature.get_label().unwrap());
15 for subfeature in feature {
16 println!(
17 " - {} = {}",
18 subfeature.name(),
19 subfeature.get_value().unwrap()
20 );
21 }
22 }
23 }
24}Sourcepub fn get_subfeature(
&self,
subfeature_type: SubfeatureType,
) -> Option<Subfeature>
pub fn get_subfeature( &self, subfeature_type: SubfeatureType, ) -> Option<Subfeature>
Returns the subfeature of the given type, if it exists, None otherwise.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Feature
impl RefUnwindSafe for Feature
impl !Send for Feature
impl !Sync for Feature
impl Unpin for Feature
impl UnwindSafe for Feature
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more