pub struct StreamingConnection<S> { /* private fields */ }
Implementations§
Source§impl<S> StreamingConnection<S>
impl<S> StreamingConnection<S>
pub fn new(socket: S) -> Self
pub fn poll_read_next( &mut self, cx: &mut Context<'_>, ) -> Poll<Result<ServerOp, StreamingReadError>>
Sourcepub async fn read_next(&mut self) -> Result<ServerOp, StreamingReadError>
pub async fn read_next(&mut self) -> Result<ServerOp, StreamingReadError>
pub fn may_write(&self) -> bool
pub fn may_flush(&self) -> bool
pub fn may_enqueue_more_ops(&self) -> bool
pub fn enqueue_write_op(&mut self, item: &ClientOp)
pub fn poll_write_next(&mut self, cx: &mut Context<'_>) -> Poll<Result<usize>>
Sourcepub async fn write_next(&mut self) -> Result<usize>
pub async fn write_next(&mut self) -> Result<usize>
Writes the next chunk of data to the socket.
It returns the number of bytes that have been written.
§Errors
An I/O error is returned if it is not possible to write to the socket.
pub fn poll_flush(&mut self, cx: &mut Context<'_>) -> Poll<Result<()>>
Sourcepub async fn shutdown(&mut self) -> Result<()>
pub async fn shutdown(&mut self) -> Result<()>
Shutdown the connection
§Errors
Returns an error if shutting down the connection fails. Implementations usually ignore this error.
pub fn socket(&self) -> &S
pub fn socket_mut(&mut self) -> &mut S
pub fn replace_socket<F, S2>(self, replacer: F) -> StreamingConnection<S2>where
F: FnOnce(S) -> S2,
pub fn into_inner(self) -> S
Trait Implementations§
Auto Trait Implementations§
impl<S> !Freeze for StreamingConnection<S>
impl<S> RefUnwindSafe for StreamingConnection<S>where
S: RefUnwindSafe,
impl<S> Send for StreamingConnection<S>where
S: Send,
impl<S> Sync for StreamingConnection<S>where
S: Sync,
impl<S> Unpin for StreamingConnection<S>where
S: Unpin,
impl<S> UnwindSafe for StreamingConnection<S>where
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