pub trait LinoProtocol:
Debug
+ Send
+ Sync {
// Required methods
fn write_document(
&self,
writer: &mut dyn Write,
document: &[LiNo<String>],
) -> ProtocolResult<()>;
fn read_document(
&self,
reader: &mut dyn BufRead,
) -> ProtocolResult<Option<LinoDocument>>;
}Expand description
Reads and writes whole LiNo documents on a byte stream.
Required Methods§
Sourcefn 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.
Sourcefn 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.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".