pub trait Formatter {
fn push_str(&mut self, s: &[u8]) -> Result<()>;
fn push_byte(&mut self, b: u8) -> Result<()>;
fn as_slice(&self) -> &[u8];
fn clear(&mut self);
fn len(&self) -> usize;
fn message_start(&mut self) -> Result<()>;
fn message_end(&mut self) -> Result<()>;
fn response_unit(&mut self) -> Result<ResponseUnit<'_>>;
fn push_ascii(&mut self, s: &[u8]) -> Result<()> { ... }
fn is_empty(&self) -> bool { ... }
fn data_separator(&mut self) -> Result<()> { ... }
fn header_separator(&mut self) -> Result<()> { ... }
}
Expand description
Formats a SCPI response
use scpi::response::ArrayVecFormatter;
let mut array = ArrayVecFormatter::<128>::new();
Required Methods
fn message_start(&mut self) -> Result<()>
fn message_start(&mut self) -> Result<()>
Start a response message
fn message_end(&mut self) -> Result<()>
fn message_end(&mut self) -> Result<()>
End a response message
fn response_unit(&mut self) -> Result<ResponseUnit<'_>>
Provided Methods
fn data_separator(&mut self) -> Result<()>
fn data_separator(&mut self) -> Result<()>
Insert a data separator
fn header_separator(&mut self) -> Result<()>
fn header_separator(&mut self) -> Result<()>
Insert a data separator