[][src]Struct gpio_cdev::LineEventHandle

pub struct LineEventHandle { /* fields omitted */ }

Handle for retrieving events from the kernel for a line

In order for userspace to retrieve incoming events on a GPIO, an event handle must be requested from the chip using Line::events. On success, the kernel creates an anonymous file descriptor for reading events. This structure is the go-between for callers and that file descriptor.

Implementations

impl LineEventHandle[src]

pub fn get_event(&self) -> Result<LineEvent, Error>[src]

Retrieve the next event from the kernel for this line

This blocks while there is not another event available from the kernel for the line which matches the subscription criteria specified in the event_flags when the handle was created.

pub fn get_value(&self) -> Result<u8, Error>[src]

Request the current state of this Line from the kernel

This value should be 0 or 1 which a "1" representing that the line is active. Usually this means that the line is at logic-level high but it could mean the opposite if the line has been marked as being ACTIVE_LOW.

pub fn line(&self) -> &Line[src]

Get the Line information associated with this handle.

Trait Implementations

impl AsRawFd for LineEventHandle[src]

fn as_raw_fd(&self) -> RawFd[src]

Gets the raw file descriptor for the LineEventHandle.

impl Debug for LineEventHandle[src]

impl Iterator for LineEventHandle[src]

type Item = Result<LineEvent, Error>

The type of the elements being iterated over.

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<I> IntoIterator for I where
    I: Iterator
[src]

type Item = <I as Iterator>::Item

The type of the elements being iterated over.

type IntoIter = I

Which kind of iterator are we turning this into?

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.