[−][src]Struct ht16k33::LedLocation
Represents the LED location.
The LED location is a (DisplayDataAddress
, DisplayData
) pair, created from a validated
(row
, common
) pair of u8
values.
Example
use ht16k33::LedLocation; use ht16k33::DisplayData; use ht16k33::DisplayDataAddress; use ht16k33::ValidationError; let row = 1u8; let common = 2u8; let location = LedLocation::new(row, common)?; assert_eq!(ht16k33::DisplayDataAddress::ROW_1, location.row); assert_eq!(ht16k33::DisplayData::COMMON_2, location.common);
Fields
row: DisplayDataAddress
The Display RAM row
address.
common: DisplayData
The Display RAM common
data.
Methods
impl LedLocation
[src]
pub fn new(row: u8, common: u8) -> Result<Self, ValidationError>
[src]
Create an LedLocation
with the given row
and common
values.
Errors
The row
and common
values are validated to be within their respective ROWS_SIZE
and
COMMONS_SIZE
ranges of the device. If validation fails then ht16k33::ValidationError::ValueTooLarge
is
returned.
use ht16k33::LedLocation; use ht16k33::ValidationError; let location = match LedLocation::new(row, common) { Ok(location) => location, Err(ValidationError) => panic!(), };
pub fn row_as_index(self) -> usize
[src]
Return the row
value.
Trait Implementations
impl PartialOrd<LedLocation> for LedLocation
[src]
fn partial_cmp(&self, other: &LedLocation) -> Option<Ordering>
[src]
fn lt(&self, other: &LedLocation) -> bool
[src]
fn le(&self, other: &LedLocation) -> bool
[src]
fn gt(&self, other: &LedLocation) -> bool
[src]
fn ge(&self, other: &LedLocation) -> bool
[src]
impl Default for LedLocation
[src]
fn default() -> LedLocation
[src]
impl Clone for LedLocation
[src]
fn clone(&self) -> LedLocation
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl PartialEq<LedLocation> for LedLocation
[src]
fn eq(&self, other: &LedLocation) -> bool
[src]
fn ne(&self, other: &LedLocation) -> bool
[src]
impl Eq for LedLocation
[src]
impl Ord for LedLocation
[src]
fn cmp(&self, other: &LedLocation) -> Ordering
[src]
fn max(self, other: Self) -> Self
1.21.0[src]
Compares and returns the maximum of two values. Read more
fn min(self, other: Self) -> Self
1.21.0[src]
Compares and returns the minimum of two values. Read more
fn clamp(self, min: Self, max: Self) -> Self
[src]
clamp
)Restrict a value to a certain interval. Read more
impl Copy for LedLocation
[src]
impl Debug for LedLocation
[src]
impl Display for LedLocation
[src]
impl Hash for LedLocation
[src]
Auto Trait Implementations
impl Send for LedLocation
impl Sync for LedLocation
Blanket Implementations
impl<T> From<T> for T
[src]
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,