pub struct LinoConnection<S: Read + Write, P: LinoProtocol> { /* private fields */ }Expand description
A byte stream decorated with a LinoProtocol.
Implementations§
Source§impl<S: Read + Write, P: LinoProtocol> LinoConnection<S, P>
impl<S: Read + Write, P: LinoProtocol> LinoConnection<S, P>
Sourcepub fn send(&mut self, document: &[LiNo<String>]) -> ProtocolResult<()>
pub fn send(&mut self, document: &[LiNo<String>]) -> ProtocolResult<()>
Sends one document.
Sourcepub fn receive(&mut self) -> ProtocolResult<Option<LinoDocument>>
pub fn receive(&mut self) -> ProtocolResult<Option<LinoDocument>>
Receives one document; Ok(None) when the peer closed the stream.
Sourcepub fn request(
&mut self,
document: &[LiNo<String>],
) -> ProtocolResult<LinoDocument>
pub fn request( &mut self, document: &[LiNo<String>], ) -> ProtocolResult<LinoDocument>
Sends document and waits for the reply.
Sourcepub fn into_inner(self) -> S
pub fn into_inner(self) -> S
Unwraps the underlying stream.
Trait Implementations§
Auto Trait Implementations§
impl<S, P> Freeze for LinoConnection<S, P>
impl<S, P> RefUnwindSafe for LinoConnection<S, P>where
P: RefUnwindSafe,
S: RefUnwindSafe,
impl<S, P> Send for LinoConnection<S, P>where
S: Send,
impl<S, P> Sync for LinoConnection<S, P>where
S: Sync,
impl<S, P> Unpin for LinoConnection<S, P>
impl<S, P> UnsafeUnpin for LinoConnection<S, P>where
P: UnsafeUnpin,
S: UnsafeUnpin,
impl<S, P> UnwindSafe for LinoConnection<S, P>where
P: UnwindSafe,
S: UnwindSafe,
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