pub struct ExchangeDemux { /* private fields */ }Expand description
Routes bytes during an exchange: URC lines are emitted live, the rest is the reply.
Each line is judged once, when it completes, so every URC occurrence (two RINGs
in one exchange) is emitted exactly once.
Implementations§
Source§impl ExchangeDemux
impl ExchangeDemux
Sourcepub fn new(command: &str, solicited_prefixes: &[String]) -> Self
pub fn new(command: &str, solicited_prefixes: &[String]) -> Self
Demux for a verbose (ATV1) modem.
Sourcepub fn with_format(
command: &str,
solicited_prefixes: &[String],
format: AtResultFormat,
) -> Self
pub fn with_format( command: &str, solicited_prefixes: &[String], format: AtResultFormat, ) -> Self
Demux that judges result codes like the completion check with format.
Sourcepub fn phase(&self) -> ExchangePhase
pub fn phase(&self) -> ExchangePhase
Whether the echo of the command has been seen.
pub fn reset(&mut self)
Sourcepub fn process_chunk(&mut self, chunk: &[u8]) -> Vec<String>
pub fn process_chunk(&mut self, chunk: &[u8]) -> Vec<String>
Process complete lines from a chunk; returns new URC lines to emit live.
Cost is linear in the chunk: only the new bytes are searched for a line end,
and an unterminated line is capped at MAX_DEMUX_LINE.
Trait Implementations§
Auto Trait Implementations§
impl Forget for ExchangeDemux
impl Freeze for ExchangeDemux
impl RefUnwindSafe for ExchangeDemux
impl Send for ExchangeDemux
impl Sync for ExchangeDemux
impl Unpin for ExchangeDemux
impl UnsafeUnpin for ExchangeDemux
impl UnwindSafe for ExchangeDemux
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