1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
//! [Error] module for [super::Display]

use display_interface::DisplayError;

///
/// An error holding its source [embedded_hal::digital::v2::OutputPin::Error]
/// or [display_interface::DisplayError]
///
#[derive(Debug)]
pub enum InitError<PE> {
    DisplayError,
    Pin(PE),
}

///
/// Alias of [DisplayError] for out-of-init use cases
/// since the pin error is only possible during [super::Builder] use
///
pub type Error = DisplayError;

impl<PE> From<DisplayError> for InitError<PE> {
    fn from(_: DisplayError) -> Self {
        InitError::DisplayError
    }
}