pub struct Chip<'sensors> { /* private fields */ }Expand description
Chip connected to sensors or actuators.
Implementations§
Source§impl<'sensors> Chip<'sensors>
impl<'sensors> Chip<'sensors>
Sourcepub unsafe fn into_raw_parts(self) -> sensors_chip_name
pub unsafe fn into_raw_parts(self) -> sensors_chip_name
§Safety
It is the responsibility of the caller to call
sensors_free_chip_name on the result.
Failing to do so leaks memory.
Sourcepub fn raw_ref(&self) -> &sensors_chip_name
pub fn raw_ref(&self) -> &sensors_chip_name
Returns a shared reference to the raw data structure sensors_chip_name.
Sourcepub unsafe fn raw_mut(&mut self) -> &mut sensors_chip_name
pub unsafe fn raw_mut(&mut self) -> &mut sensors_chip_name
Returns an exclusive reference to the raw data structure sensors_chip_name.
§Safety
Changing the raw data structure in an unsupported way leads to undefined results.
Sourcepub fn set_bus(&mut self, new_bus: &Bus)
pub fn set_bus(&mut self, new_bus: &Bus)
Set the bus connected to this chip.
See: Chip::do_chip_sets.
Sourcepub fn feature_iter(&'sensors self) -> Iter<'sensors> ⓘ
pub fn feature_iter(&'sensors self) -> Iter<'sensors> ⓘ
Return an iterator which yields all sensors and actuators (a.k.a., features) controlled by this chip.
Sourcepub fn prefix(&self) -> Option<Result<&str>>
pub fn prefix(&self) -> Option<Result<&str>>
Return the prefix of this chip, if it is valid UTF-8.
Sourcepub fn do_chip_sets(&self) -> Result<()>
pub fn do_chip_sets(&self) -> Result<()>
Execute all set statements for this chip.
See: sensors_do_chip_sets.
Sourcepub fn raw_prefix(&self) -> Option<&CStr>
pub fn raw_prefix(&self) -> Option<&CStr>
Return the raw prefix of this chip, if available.
Sourcepub fn raw_path(&self) -> Option<&CStr>
pub fn raw_path(&self) -> Option<&CStr>
Return the raw path of the driver of this chip, if available.
Sourcepub fn raw_address(&self) -> c_int
pub fn raw_address(&self) -> c_int
Return the raw address of this chip, which is either a number,
or SENSORS_CHIP_NAME_ADDR_ANY.