pub struct AsyncChip(_);
Expand description

Async wrapper around Chip for the tokio reactor.

Example

use gpiocdev::chip::Chip;
use gpiocdev::r#async::tokio::AsyncChip;

let chip = Chip::from_path("/dev/gpiochip0")?;
let achip = AsyncChip::new(chip);
let evt = achip.read_line_info_change_event().await?;

Implementations

Create a Tokio wrapper for a Chip.

Async form of Chip::read_line_info_change_event.

Example
use gpiocdev::r#async::tokio::AsyncChip;

let chip = Chip::from_path("/dev/gpiochip0")?;
let achip = AsyncChip::new(chip);
let evt = achip.read_line_info_change_event().await?;

Async form of Chip::info_change_events.

Example
use gpiocdev::r#async::tokio::AsyncChip;
use tokio_stream::StreamExt;

let chip = Chip::from_path("/dev/gpiochip0")?;
let achip = AsyncChip::new(chip);
let mut events = achip.info_change_events();
while let Ok(evt) = events.next().await.unwrap() {
    // process event...
}

Trait Implementations

Converts this type into a shared reference of the (usually inferred) input type.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.