Trait AsValuesMut

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

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

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

Required Methods§

Source

fn set(&mut self, id: u8, 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: u8, 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>(&mut self, other: &T)
where T: AsValues,

Copy values to another variable

Source

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

Fill values in range

Source

fn truncate(&mut self, len: u8)

Truncate mask

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl AsValuesMut for u8

Source§

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

Source§

impl AsValuesMut for u16

Source§

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

Source§

impl AsValuesMut for u32

Source§

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

Source§

impl AsValuesMut for u64

Source§

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

Source§

impl AsValuesMut for Vec<Option<bool>>

Source§

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

Source§

impl AsValuesMut for Vec<bool>

Source§

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

Source§

impl AsValuesMut for [Option<bool>]

Source§

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

Source§

impl AsValuesMut for [bool]

Source§

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

Source§

impl<T> AsValuesMut for &mut T
where T: AsValuesMut,

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Implementors§