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
impl Settings
Sourcepub fn set_prop(&mut self, props: &[SettingVal]) -> Result<&mut Self>
pub fn set_prop(&mut self, props: &[SettingVal]) -> Result<&mut Self>
Set line prop setting.
Sourcepub fn prop(&self, property: SettingKind) -> Result<SettingVal>
pub fn prop(&self, property: SettingKind) -> Result<SettingVal>
Get the line prop setting.
Sourcepub fn set_direction(&mut self, direction: Direction) -> Result<&mut Self>
pub fn set_direction(&mut self, direction: Direction) -> Result<&mut Self>
Set the line direction.
Sourcepub fn set_edge_detection(&mut self, edge: Option<Edge>) -> Result<&mut Self>
pub fn set_edge_detection(&mut self, edge: Option<Edge>) -> Result<&mut Self>
Set the edge event detection setting.
Sourcepub fn edge_detection(&self) -> Result<Option<Edge>>
pub fn edge_detection(&self) -> Result<Option<Edge>>
Get the edge event detection setting.
Sourcepub fn set_active_low(&mut self, active_low: bool) -> &mut Self
pub fn set_active_low(&mut self, active_low: bool) -> &mut Self
Set active-low setting.
Sourcepub fn active_low(&self) -> bool
pub fn active_low(&self) -> bool
Check the active-low setting.
Sourcepub fn set_debounce_period(&mut self, period: Duration) -> &mut Self
pub fn set_debounce_period(&mut self, period: Duration) -> &mut Self
Set the debounce period setting.
Sourcepub fn debounce_period(&self) -> Result<Duration>
pub fn debounce_period(&self) -> Result<Duration>
Get the debounce period.
Sourcepub fn set_event_clock(&mut self, clock: EventClock) -> Result<&mut Self>
pub fn set_event_clock(&mut self, clock: EventClock) -> Result<&mut Self>
Set the event clock setting.
Sourcepub fn event_clock(&self) -> Result<EventClock>
pub fn event_clock(&self) -> Result<EventClock>
Get the event clock setting.
Sourcepub fn set_output_value(&mut self, value: Value) -> Result<&mut Self>
pub fn set_output_value(&mut self, value: Value) -> Result<&mut Self>
Set the output value setting.
Sourcepub fn output_value(&self) -> Result<Value>
pub fn output_value(&self) -> Result<Value>
Get the output value, 0 or 1.