AsValues

Trait AsValues 

Source
pub trait AsValues {
    // Required methods
    fn bits(&self) -> BitId;
    fn get(&self, id: BitId) -> Option<bool>;

    // Provided methods
    fn copy_into<T: AsValuesMut>(&self, other: &mut T) { ... }
    fn convert<T: AsValuesMut + Default>(&self) -> T { ... }
}
Expand description

Something that can be used to get GPIO line values

Required Methods§

Source

fn bits(&self) -> BitId

Source

fn get(&self, id: BitId) -> Option<bool>

Get the value of specific bit identified by offset

If bit is out of range (0..bits) or not masked then None should be returned.

Provided Methods§

Source

fn copy_into<T: AsValuesMut>(&self, other: &mut T)

Copy values to another variable

Source

fn convert<T: AsValuesMut + Default>(&self) -> T

Convert to another representation

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 AsValues for u8

Source§

fn bits(&self) -> BitId

Source§

fn get(&self, id: BitId) -> Option<bool>

Source§

impl AsValues for u16

Source§

fn bits(&self) -> BitId

Source§

fn get(&self, id: BitId) -> Option<bool>

Source§

impl AsValues for u32

Source§

fn bits(&self) -> BitId

Source§

fn get(&self, id: BitId) -> Option<bool>

Source§

impl AsValues for u64

Source§

fn bits(&self) -> BitId

Source§

fn get(&self, id: BitId) -> Option<bool>

Source§

impl AsValues for Vec<Option<bool>>

Source§

fn bits(&self) -> BitId

Source§

fn get(&self, id: BitId) -> Option<bool>

Source§

impl AsValues for Vec<bool>

Source§

fn bits(&self) -> BitId

Source§

fn get(&self, id: BitId) -> Option<bool>

Source§

impl AsValues for [Option<bool>]

Source§

fn bits(&self) -> BitId

Source§

fn get(&self, id: BitId) -> Option<bool>

Source§

impl AsValues for [bool]

Source§

fn bits(&self) -> BitId

Source§

fn get(&self, id: BitId) -> Option<bool>

Source§

impl<T: AsValues> AsValues for &T

Source§

fn bits(&self) -> BitId

Source§

fn get(&self, id: BitId) -> Option<bool>

Source§

impl<T: AsValues> AsValues for &mut T

Source§

fn bits(&self) -> BitId

Source§

fn get(&self, id: BitId) -> Option<bool>

Source§

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

Source§

fn bits(&self) -> BitId

Source§

fn get(&self, id: BitId) -> Option<bool>

Source§

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

Source§

fn bits(&self) -> BitId

Source§

fn get(&self, id: BitId) -> Option<bool>

Implementors§