Struct Settings

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

Line settings objects.

Line settings object contains a set of line properties that can be used when requesting lines or reconfiguring an existing request.

Mutators in general can only fail if the new property value is invalid. The return values can be safely ignored - the object remains valid even after a mutator fails and simply uses the sane default appropriate for given property.

Implementations§

Source§

impl Settings

Source

pub fn new() -> Result<Self>

Create a new line settings object.

Source

pub fn reset(&mut self)

Resets the line settings object to its default values.

Source

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

Makes a copy of the settings object.

Source

pub fn set_prop(&mut self, props: &[SettingVal]) -> Result<&mut Self>

Set line prop setting.

Source

pub fn prop(&self, property: SettingKind) -> Result<SettingVal>

Get the line prop setting.

Source

pub fn set_direction(&mut self, direction: Direction) -> Result<&mut Self>

Set the line direction.

Source

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

Get the direction setting.

Source

pub fn set_edge_detection(&mut self, edge: Option<Edge>) -> Result<&mut Self>

Set the edge event detection setting.

Source

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

Get the edge event detection setting.

Source

pub fn set_bias(&mut self, bias: Option<Bias>) -> Result<&mut Self>

Set the bias setting.

Source

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

Get the bias setting.

Source

pub fn set_drive(&mut self, drive: Drive) -> Result<&mut Self>

Set the drive setting.

Source

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

Get the drive setting.

Source

pub fn set_active_low(&mut self, active_low: bool) -> &mut Self

Set active-low setting.

Source

pub fn active_low(&self) -> bool

Check the active-low setting.

Source

pub fn set_debounce_period(&mut self, period: Duration) -> &mut Self

Set the debounce period setting.

Source

pub fn debounce_period(&self) -> Result<Duration>

Get the debounce period.

Source

pub fn set_event_clock(&mut self, clock: EventClock) -> Result<&mut Self>

Set the event clock setting.

Source

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

Get the event clock setting.

Source

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

Set the output value setting.

Source

pub fn output_value(&self) -> Result<Value>

Get the output value, 0 or 1.

Trait Implementations§

Source§

impl Debug for Settings

Source§

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

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

impl Drop for Settings

Source§

fn drop(&mut self)

Free the line settings object and release all associated resources.

Source§

impl PartialEq for Settings

Source§

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

Source§

impl Send for Settings

Source§

impl StructuralPartialEq for Settings

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.