Chip

Struct Chip 

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

Chip connected to sensors or actuators.

Implementations§

Source§

impl<'sensors> Chip<'sensors>

Source

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.

Source

pub fn raw_ref(&self) -> &sensors_chip_name

Returns a shared reference to the raw data structure sensors_chip_name.

Source

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.

Source

pub fn as_ref(&'sensors self) -> ChipRef<'sensors>

Return a shared reference to this chip.

Source

pub fn set_bus(&mut self, new_bus: &Bus)

Set the bus connected to this chip.

See: Chip::do_chip_sets.

Source

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.

Source

pub fn name(&self) -> Result<String>

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

Source

pub fn prefix(&self) -> Option<Result<&str>>

Return the prefix of this chip, if it is valid UTF-8.

Source

pub fn path(&self) -> Option<&Path>

Return the path of the driver of this chip, if available.

Source

pub fn address(&self) -> Option<c_int>

Return the address of this chip, if available.

Source

pub fn do_chip_sets(&self) -> Result<()>

Execute all set statements for this chip.

See: sensors_do_chip_sets.

Source

pub fn bus(&self) -> Bus

Return a copy of the bus connected to this chip.

Source

pub fn raw_name(&self) -> Result<CString>

Return the raw name of this chip.

See: sensors_snprintf_chip_name.

Source

pub fn raw_prefix(&self) -> Option<&CStr>

Return the raw prefix of this chip, if available.

Source

pub fn raw_path(&self) -> Option<&CStr>

Return the raw path of the driver of this chip, if available.

Source

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.

Trait Implementations§

Source§

impl<'sensors> Debug for Chip<'sensors>

Source§

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

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

impl Display for Chip<'_>

Source§

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

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

impl Drop for Chip<'_>

Source§

impl PartialEq<Chip<'_>> for ChipRef<'_>

Source§

fn eq(&self, other: &Chip<'_>) -> 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 PartialEq<ChipRef<'_>> for Chip<'_>

Source§

fn eq(&self, other: &ChipRef<'_>) -> 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> PartialEq for Chip<'sensors>

Source§

fn eq(&self, other: &Chip<'sensors>) -> 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> Eq for Chip<'sensors>

Source§

impl<'sensors> StructuralPartialEq for Chip<'sensors>

Auto Trait Implementations§

§

impl<'sensors> Freeze for Chip<'sensors>

§

impl<'sensors> !RefUnwindSafe for Chip<'sensors>

§

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

§

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

§

impl<'sensors> Unpin for Chip<'sensors>

§

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