#[repr(C)]pub struct LineValues(/* private fields */);
Expand description
The logical values of the requested lines.
Values are stored as u8, as that is what the uAPI specifies.
0 is inactive with 1 and all other values taken as active.
Values are stored in the same order as the offsets in the HandleRequest.offsets
.
Values for input lines are ignored.
Implementations§
Source§impl LineValues
impl LineValues
Sourcepub fn from_slice(s: &[u8]) -> Self
pub fn from_slice(s: &[u8]) -> Self
Create values from a slice.
The values are in the same order as HandleRequest.offsets
.
Sourcepub fn copy_from_slice(&mut self, s: &[u8])
pub fn copy_from_slice(&mut self, s: &[u8])
Copy values from an iterable list - in order of requested offsets.
Sourcepub fn get(&self, idx: usize) -> u8
pub fn get(&self, idx: usize) -> u8
Return the value of a line.
Note that the LineValues
need to be populated via a call to get_line_values
to get values from the underlying hardware.
idx
- The index into theHandleRequest.offsets
for the line of interest.
Sourcepub fn set(&mut self, idx: usize, value: u8)
pub fn set(&mut self, idx: usize, value: u8)
Set the value of a line.
Note that this is not applied to hardware until these values are passed to
set_line_values
.
idx
- The index into theHandleRequest.offsets
for the line of interest.value
- The logical state of the line to be set.
Trait Implementations§
Source§impl Clone for LineValues
impl Clone for LineValues
Source§fn clone(&self) -> LineValues
fn clone(&self) -> LineValues
Returns a duplicate of the value. Read more
1.0.0 · Source§const fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for LineValues
impl Debug for LineValues
Source§impl Default for LineValues
impl Default for LineValues
Source§impl PartialEq for LineValues
impl PartialEq for LineValues
impl Copy for LineValues
impl Eq for LineValues
impl StructuralPartialEq for LineValues
Auto Trait Implementations§
impl Freeze for LineValues
impl RefUnwindSafe for LineValues
impl Send for LineValues
impl Sync for LineValues
impl Unpin for LineValues
impl UnwindSafe for LineValues
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more