Struct Request

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

Line request operations

Allows interaction with a set of requested lines.

Implementations§

Source§

impl Request

Source

pub fn num_lines(&self) -> usize

Get the number of lines in the request.

Source

pub fn offsets(&self) -> Vec<Offset>

Get the offsets of lines in the request.

Source

pub fn value(&self, offset: Offset) -> Result<Value>

Get the value (0 or 1) of a single line associated with the request.

Source

pub fn values_subset(&self, offsets: &[Offset]) -> Result<ValueMap>

Get values of a subset of lines associated with the request.

Source

pub fn values(&self) -> Result<ValueMap>

Get values of all lines associated with the request.

Source

pub fn set_value(&mut self, offset: Offset, value: Value) -> Result<&mut Self>

Set the value of a single line associated with the request.

Source

pub fn set_values_subset(&mut self, map: ValueMap) -> Result<&mut Self>

Set values of a subset of lines associated with the request.

Source

pub fn set_values(&mut self, values: &[Value]) -> Result<&mut Self>

Set values of all lines associated with the request.

Source

pub fn reconfigure_lines(&mut self, lconfig: &Config) -> Result<&mut Self>

Update the configuration of lines associated with the line request.

Source

pub fn wait_edge_events(&self, timeout: Option<Duration>) -> Result<bool>

Wait for edge events on any of the lines associated with the request.

Source

pub fn read_edge_events<'a>(&self, buffer: &'a mut Buffer) -> Result<Events<'a>>

Get a number of edge events from a line request.

This function will block if no event was queued for the line.

Trait Implementations§

Source§

impl AsRawFd for Request

Source§

fn as_raw_fd(&self) -> i32

Get the file descriptor associated with the line request.

Source§

impl Debug for Request

Source§

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

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

impl Drop for Request

Source§

fn drop(&mut self)

Release the requested lines and free all associated resources.

Source§

impl PartialEq for Request

Source§

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

Source§

impl Send for Request

Source§

impl StructuralPartialEq for Request

Auto Trait Implementations§

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, 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.