Trait gpiod_core::AsValuesMut

source ·
pub trait AsValuesMut: AsValues {
    // Required method
    fn set(&mut self, id: BitId, val: Option<bool>);

    // Provided methods
    fn with(self, id: BitId, val: Option<bool>) -> Self
       where Self: Sized { ... }
    fn copy_from<T: AsValues>(&mut self, other: &T) { ... }
    fn fill<R: Iterator<Item = BitId>>(&mut self, range: R, val: Option<bool>) { ... }
    fn truncate(&mut self, len: BitId) { ... }
}
Expand description

Something that can be used to get and set GPIO line values

Required Methods§

source

fn set(&mut self, id: BitId, val: Option<bool>)

Set the value of specific bit identified by offset

If bit if out of range (0..bits) then nothing should be set.

Provided Methods§

source

fn with(self, id: BitId, val: Option<bool>) -> Self
where Self: Sized,

Change the value of specific bit identified by offset

If bit if out of range (0..bits) then nothing will be changed.

source

fn copy_from<T: AsValues>(&mut self, other: &T)

Copy values to another variable

source

fn fill<R: Iterator<Item = BitId>>(&mut self, range: R, val: Option<bool>)

Fill values in range

source

fn truncate(&mut self, len: BitId)

Truncate mask

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl AsValuesMut for u8

source§

fn set(&mut self, id: BitId, val: Option<bool>)

source§

impl AsValuesMut for u16

source§

fn set(&mut self, id: BitId, val: Option<bool>)

source§

impl AsValuesMut for u32

source§

fn set(&mut self, id: BitId, val: Option<bool>)

source§

impl AsValuesMut for u64

source§

fn set(&mut self, id: BitId, val: Option<bool>)

source§

impl AsValuesMut for Vec<Option<bool>>

source§

fn set(&mut self, id: BitId, val: Option<bool>)

source§

impl AsValuesMut for Vec<bool>

source§

fn set(&mut self, id: BitId, val: Option<bool>)

source§

impl AsValuesMut for [Option<bool>]

source§

fn set(&mut self, id: BitId, val: Option<bool>)

source§

impl AsValuesMut for [bool]

source§

fn set(&mut self, id: BitId, val: Option<bool>)

source§

impl<T: AsValuesMut> AsValuesMut for &mut T

source§

fn set(&mut self, id: BitId, val: Option<bool>)

source§

impl<const LEN: usize> AsValuesMut for [Option<bool>; LEN]

source§

fn set(&mut self, id: BitId, val: Option<bool>)

source§

impl<const LEN: usize> AsValuesMut for [bool; LEN]

source§

fn set(&mut self, id: BitId, val: Option<bool>)

Implementors§