pub struct AsyncRdmaStream<T: Transport> { /* private fields */ }Expand description
An async RDMA stream with read and write methods.
Generic over T: Transport. Construct via AsyncRdmaStream::new with
a pre-built transport.
Implementations§
Source§impl<T: Transport> AsyncRdmaStream<T>
impl<T: Transport> AsyncRdmaStream<T>
Sourcepub async fn read(&mut self, buf: &mut [u8]) -> Result<usize>
pub async fn read(&mut self, buf: &mut [u8]) -> Result<usize>
Read data from the stream asynchronously.
Returns the number of bytes read. Returns Ok(0) on disconnect (EOF).
Sourcepub async fn write(&mut self, data: &[u8]) -> Result<usize>
pub async fn write(&mut self, data: &[u8]) -> Result<usize>
Write data to the stream asynchronously.
Returns the number of bytes written (bounded by buffer size).
Sourcepub async fn write_all(&mut self, data: &[u8]) -> Result<()>
pub async fn write_all(&mut self, data: &[u8]) -> Result<()>
Write all data to the stream, looping if necessary.
Sourcepub fn peer_addr(&self) -> Option<SocketAddr>
pub fn peer_addr(&self) -> Option<SocketAddr>
Get the peer’s socket address (remote end of the connection).
Sourcepub fn local_addr(&self) -> Option<SocketAddr>
pub fn local_addr(&self) -> Option<SocketAddr>
Get the local socket address.
Trait Implementations§
Source§impl<T: Transport> AsyncRead for AsyncRdmaStream<T>
impl<T: Transport> AsyncRead for AsyncRdmaStream<T>
Source§impl<T: Transport> AsyncWrite for AsyncRdmaStream<T>
impl<T: Transport> AsyncWrite for AsyncRdmaStream<T>
Source§fn poll_write(
self: Pin<&mut Self>,
cx: &mut Context<'_>,
buf: &[u8],
) -> Poll<Result<usize>>
fn poll_write( self: Pin<&mut Self>, cx: &mut Context<'_>, buf: &[u8], ) -> Poll<Result<usize>>
Attempt to write bytes from
buf into the object. Read moreSource§fn poll_flush(self: Pin<&mut Self>, _cx: &mut Context<'_>) -> Poll<Result<()>>
fn poll_flush(self: Pin<&mut Self>, _cx: &mut Context<'_>) -> Poll<Result<()>>
Attempt to flush the object, ensuring that any buffered data reach
their destination. Read more
Source§impl<T: Transport> Debug for AsyncRdmaStream<T>
impl<T: Transport> Debug for AsyncRdmaStream<T>
Source§impl<T: Transport> Drop for AsyncRdmaStream<T>
impl<T: Transport> Drop for AsyncRdmaStream<T>
impl<T: Transport> Unpin for AsyncRdmaStream<T>
Auto Trait Implementations§
impl<T> Freeze for AsyncRdmaStream<T>where
T: Freeze,
impl<T> RefUnwindSafe for AsyncRdmaStream<T>where
T: RefUnwindSafe,
impl<T> Send for AsyncRdmaStream<T>
impl<T> Sync for AsyncRdmaStream<T>
impl<T> UnsafeUnpin for AsyncRdmaStream<T>where
T: UnsafeUnpin,
impl<T> UnwindSafe for AsyncRdmaStream<T>where
T: 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