pub struct TextLinoProtocol {
pub limits: DecodeLimits,
}Expand description
UTF-8 LiNo text, one message per block of lines ended by a line holding
only .. Lines starting with . get one extra . (SMTP dot-stuffing).
Lines may end with \n or \r\n; a carriage return right before a line
feed is dropped, so a quoted reference holding \r\n arrives as \n
(use BinaryLinoProtocol to carry such references exactly).
Fields§
§limits: DecodeLimitsLimits applied when reading.
Implementations§
Source§impl TextLinoProtocol
impl TextLinoProtocol
Sourcepub fn write_text(writer: &mut dyn Write, text: &str) -> ProtocolResult<()>
pub fn write_text(writer: &mut dyn Write, text: &str) -> ProtocolResult<()>
Frames already formatted LiNo text as one message.
Trait Implementations§
Source§impl Clone for TextLinoProtocol
impl Clone for TextLinoProtocol
Source§fn clone(&self) -> TextLinoProtocol
fn clone(&self) -> TextLinoProtocol
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for TextLinoProtocol
Source§impl Debug for TextLinoProtocol
impl Debug for TextLinoProtocol
Source§impl Default for TextLinoProtocol
impl Default for TextLinoProtocol
Source§fn default() -> TextLinoProtocol
fn default() -> TextLinoProtocol
Returns the “default value” for a type. Read more
impl Eq for TextLinoProtocol
Source§impl LinoProtocol for TextLinoProtocol
impl LinoProtocol for TextLinoProtocol
Source§fn write_document(
&self,
writer: &mut dyn Write,
document: &[LiNo<String>],
) -> ProtocolResult<()>
fn write_document( &self, writer: &mut dyn Write, document: &[LiNo<String>], ) -> ProtocolResult<()>
Writes one message carrying
document.Source§fn read_document(
&self,
reader: &mut dyn BufRead,
) -> ProtocolResult<Option<LinoDocument>>
fn read_document( &self, reader: &mut dyn BufRead, ) -> ProtocolResult<Option<LinoDocument>>
Reads one message;
Ok(None) when the stream ended cleanly.Source§impl PartialEq for TextLinoProtocol
impl PartialEq for TextLinoProtocol
impl StructuralPartialEq for TextLinoProtocol
Auto Trait Implementations§
impl Freeze for TextLinoProtocol
impl RefUnwindSafe for TextLinoProtocol
impl Send for TextLinoProtocol
impl Sync for TextLinoProtocol
impl Unpin for TextLinoProtocol
impl UnsafeUnpin for TextLinoProtocol
impl UnwindSafe for TextLinoProtocol
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