pub enum Connection<S1, S2> {
Streaming(StreamingConnection<S1>),
Websocket(WebsocketConnection<S2>),
}Variants§
Streaming(StreamingConnection<S1>)
Websocket(WebsocketConnection<S2>)
Implementations§
Source§impl<S1, S2> Connection<S1, S2>
impl<S1, S2> Connection<S1, S2>
pub fn poll_read_next( &mut self, cx: &mut Context<'_>, ) -> Poll<Result<ServerOp, ConnectionReadError>>
Sourcepub async fn read_next(&mut self) -> Result<ServerOp, ConnectionReadError>
pub async fn read_next(&mut self) -> Result<ServerOp, ConnectionReadError>
Read the next incoming server operation.
§Errors
Returns an error if reading or decoding the message fails.
pub fn flushes_automatically_when_full(&self) -> bool
pub fn should_flush(&self) -> bool
pub fn may_enqueue_more_ops(&mut self) -> bool
pub fn enqueue_write_op(&mut self, item: &ClientOp)
Sourcepub async fn write_and_flush(&mut self) -> Result<()>
pub async fn write_and_flush(&mut self) -> Result<()>
Convenience function for writing enqueued messages and flushing.
§Errors
Returns an error if writing or flushing fails.
pub fn poll_flush(&mut self, cx: &mut Context<'_>) -> Poll<Result<()>>
Trait Implementations§
Auto Trait Implementations§
impl<S1, S2> !Freeze for Connection<S1, S2>
impl<S1, S2> RefUnwindSafe for Connection<S1, S2>where
S1: RefUnwindSafe,
S2: RefUnwindSafe,
impl<S1, S2> Send for Connection<S1, S2>
impl<S1, S2> Sync for Connection<S1, S2>
impl<S1, S2> Unpin for Connection<S1, S2>
impl<S1, S2> UnwindSafe for Connection<S1, S2>where
S1: UnwindSafe,
S2: 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