Struct Info

Source
pub struct Info { /* private fields */ }
Expand description

Line info

This is the owned counterpart to InfoRef. Due to a Deref implementation, all functions of InfoRef can also be called on this type.

Methods from Deref<Target = InfoRef>§

Source

pub fn try_clone(&self) -> Result<Info>

Clones the line info object.

Source

pub fn offset(&self) -> Offset

Get the offset of the line within the GPIO chip.

The offset uniquely identifies the line on the chip. The combination of the chip and offset uniquely identifies the line within the system.

Source

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

Get GPIO line’s name.

Source

pub fn is_used(&self) -> bool

Returns True if the line is in use, false otherwise.

The user space can’t know exactly why a line is busy. It may have been requested by another process or hogged by the kernel. It only matters that the line is used and we can’t request it.

Source

pub fn consumer(&self) -> Result<&str>

Get the GPIO line’s consumer name.

Source

pub fn direction(&self) -> Result<Direction>

Get the GPIO line’s direction.

Source

pub fn is_active_low(&self) -> bool

Returns true if the line is “active-low”, false otherwise.

Source

pub fn bias(&self) -> Result<Option<Bias>>

Get the GPIO line’s bias setting.

Source

pub fn drive(&self) -> Result<Drive>

Get the GPIO line’s drive setting.

Source

pub fn edge_detection(&self) -> Result<Option<Edge>>

Get the current edge detection setting of the line.

Source

pub fn event_clock(&self) -> Result<EventClock>

Get the current event clock setting used for edge event timestamps.

Source

pub fn is_debounced(&self) -> bool

Returns true if the line is debounced (either by hardware or by the kernel software debouncer), false otherwise.

Source

pub fn debounce_period(&self) -> Duration

Get the debounce period of the line.

Trait Implementations§

Source§

impl Debug for Info

Source§

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

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

impl Deref for Info

Source§

type Target = InfoRef

The resulting type after dereferencing.
Source§

fn deref(&self) -> &Self::Target

Dereferences the value.
Source§

impl Drop for Info

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

impl Send for Info

Auto Trait Implementations§

§

impl Freeze for Info

§

impl RefUnwindSafe for Info

§

impl !Sync for Info

§

impl Unpin for Info

§

impl UnwindSafe for Info

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<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
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.