pub struct BinaryLinoProtocol {
pub options: BinaryLinoOptions,
pub limits: DecodeLimits,
}Expand description
Binary links packets (see crate::protocol::packet); every message is
self-delimiting, so no extra framing is needed.
Fields§
§options: BinaryLinoOptionsOptional features used when writing.
limits: DecodeLimitsLimits applied when reading.
Implementations§
Source§impl BinaryLinoProtocol
impl BinaryLinoProtocol
Sourcepub fn with_options(options: BinaryLinoOptions) -> Self
pub fn with_options(options: BinaryLinoOptions) -> Self
A binary protocol with the given optional features.
Sourcepub fn encode(&self, document: &[LiNo<String>]) -> ProtocolResult<Vec<u8>>
pub fn encode(&self, document: &[LiNo<String>]) -> ProtocolResult<Vec<u8>>
Encodes a document into packet bytes.
Sourcepub fn decode(&self, bytes: &[u8]) -> ProtocolResult<LinoDocument>
pub fn decode(&self, bytes: &[u8]) -> ProtocolResult<LinoDocument>
Decodes packet bytes into a document.
Trait Implementations§
Source§impl Clone for BinaryLinoProtocol
impl Clone for BinaryLinoProtocol
Source§fn clone(&self) -> BinaryLinoProtocol
fn clone(&self) -> BinaryLinoProtocol
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 BinaryLinoProtocol
Source§impl Debug for BinaryLinoProtocol
impl Debug for BinaryLinoProtocol
Source§impl Default for BinaryLinoProtocol
impl Default for BinaryLinoProtocol
Source§fn default() -> BinaryLinoProtocol
fn default() -> BinaryLinoProtocol
Returns the “default value” for a type. Read more
impl Eq for BinaryLinoProtocol
Source§impl LinoProtocol for BinaryLinoProtocol
impl LinoProtocol for BinaryLinoProtocol
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 BinaryLinoProtocol
impl PartialEq for BinaryLinoProtocol
impl StructuralPartialEq for BinaryLinoProtocol
Auto Trait Implementations§
impl Freeze for BinaryLinoProtocol
impl RefUnwindSafe for BinaryLinoProtocol
impl Send for BinaryLinoProtocol
impl Sync for BinaryLinoProtocol
impl Unpin for BinaryLinoProtocol
impl UnsafeUnpin for BinaryLinoProtocol
impl UnwindSafe for BinaryLinoProtocol
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