ChipRef

Struct ChipRef 

Source
pub struct ChipRef<'sensors>(/* private fields */);
Expand description

Shared reference to a chip connected to sensors or actuators.

Implementations§

Source§

impl<'sensors> ChipRef<'sensors>

Source

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

Returns a shared reference to the raw data structure sensors_chip_name.

Source

pub fn feature_iter(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<&'sensors str>>

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

Source

pub fn path(self) -> Option<&'sensors 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<&'sensors CStr>

Return the raw prefix of this chip, if available.

Source

pub fn raw_path(self) -> Option<&'sensors 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> Clone for ChipRef<'sensors>

Source§

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

Source§

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

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

impl Display for ChipRef<'_>

Source§

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

Formats the value using the given formatter. Read more
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 PartialEq<ChipRef<'_>> for ChipRef<'_>

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> Copy for ChipRef<'sensors>

Source§

impl<'sensors> Eq for ChipRef<'sensors>

Auto Trait Implementations§

§

impl<'sensors> Freeze for ChipRef<'sensors>

§

impl<'sensors> RefUnwindSafe for ChipRef<'sensors>

§

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

§

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

§

impl<'sensors> Unpin for ChipRef<'sensors>

§

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