pub struct Minitel<S> {
pub port: S,
}Expand description
Minitel interface, the entry point to the library
This struct wraps a serial port (websocket, physical, file, …) and provides methods to interact with the device.
This struct can be initialized using the ws_minitel, esp_minitel or esp_minitel_uart2
functions, depending on the target platform and enabled features. It can also operate on any
std::io::Read and/or std::io::Write object.
Fields§
§port: SImplementations§
Source§impl<S> Minitel<S>where
S: MinitelRead + MinitelWrite,
impl<S> Minitel<S>where
S: MinitelRead + MinitelWrite,
pub fn clear_screen(&mut self) -> Result<(), Error>
pub fn read_rom(&mut self) -> Result<Rom, Error>
pub fn get_pos(&mut self) -> Result<(u8, u8), Error>
pub fn set_function_mode( &mut self, mode: FunctionMode, enable: bool, ) -> Result<(), Error>
pub fn set_routing( &mut self, enable: bool, recepter: RoutingRx, emitter: RoutingTx, ) -> Result<(), Error>
pub fn get_speed(&mut self) -> Result<Baudrate, Error>
pub fn set_rouleau(&mut self, enable: bool) -> Result<(), Error>
pub fn set_procedure(&mut self, enable: bool) -> Result<(), Error>
pub fn set_minuscule(&mut self, enable: bool) -> Result<(), Error>
Source§impl<S> Minitel<S>where
S: MinitelRead,
impl<S> Minitel<S>where
S: MinitelRead,
Sourcepub fn read_bytes(&mut self, data: &mut [u8]) -> Result<(), Error>
pub fn read_bytes(&mut self, data: &mut [u8]) -> Result<(), Error>
Read a raw sequence from the minitel
Sourcepub fn read_s0_stroke(&mut self) -> Result<UserInput, Error>
pub fn read_s0_stroke(&mut self) -> Result<UserInput, Error>
Read a key stroke from the minitel assuming it is in S0 (text) mode.
G0 and G2 characters are returned as unicode characters.
pub fn wait_for(&mut self, byte: impl Into<u8> + Copy) -> Result<(), Error>
pub fn expect_read(&mut self, byte: impl Into<u8> + Copy) -> Result<(), Error>
pub fn read_pro2(&mut self, expected_ack: Pro2Resp) -> Result<u8, Error>
pub fn read_pro3(&mut self, expected_ack: Pro3Resp) -> Result<(u8, u8), Error>
Source§impl<S> Minitel<S>where
S: MinitelWrite,
impl<S> Minitel<S>where
S: MinitelWrite,
Sourcepub fn write_bytes(&mut self, data: &[u8]) -> Result<(), Error>
pub fn write_bytes(&mut self, data: &[u8]) -> Result<(), Error>
Write a raw sequence to the minitel
Sourcepub fn write_byte<T>(&mut self, byte: T) -> Result<(), Error>
pub fn write_byte<T>(&mut self, byte: T) -> Result<(), Error>
Write a single byte to the minitel
pub fn write_sequence<const N: usize>( &mut self, sequence: impl IntoSequence<N>, ) -> Result<(), Error>
pub fn c1(&mut self, c1: C1) -> Result<(), Error>
pub fn write_g2(&mut self, g2: G2) -> Result<(), Error>
pub fn show_cursor(&mut self) -> Result<(), Error>
pub fn hide_cursor(&mut self) -> Result<(), Error>
pub fn set_pos(&mut self, x: u8, y: u8) -> Result<(), Error>
pub fn cursor_down(&mut self) -> Result<(), Error>
pub fn cursor_up(&mut self) -> Result<(), Error>
pub fn cursor_right(&mut self) -> Result<(), Error>
pub fn cursor_left(&mut self) -> Result<(), Error>
pub fn start_zone(&mut self, funcs: &[C1]) -> Result<(), Error>
pub fn zone_delimiter(&mut self) -> Result<(), Error>
pub fn write_char(&mut self, c: char) -> Result<(), Error>
pub fn si_char(&mut self, c: SIChar) -> Result<(), Error>
pub fn write_str(&mut self, s: &str) -> Result<(), Error>
pub fn writeln(&mut self, s: &str) -> Result<(), Error>
Auto Trait Implementations§
impl<S> Freeze for Minitel<S>where
S: Freeze,
impl<S> RefUnwindSafe for Minitel<S>where
S: RefUnwindSafe,
impl<S> Send for Minitel<S>where
S: Send,
impl<S> Sync for Minitel<S>where
S: Sync,
impl<S> Unpin for Minitel<S>where
S: Unpin,
impl<S> UnwindSafe for Minitel<S>where
S: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more