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

Push raw string to output

Push single byte to output

Get underlying buffer as a byte slice

Clear buffer

Returns length of buffer

Start a response message

End a response message

Provided Methods

Push ascii to output, panics if

Insert a data separator

Insert a data separator

Implementors