Struct udp_stream::UdpStream
source · [−]pub struct UdpStream { /* private fields */ }
Expand description
Implementations
sourceimpl UdpStream
impl UdpStream
sourcepub async fn connect(addr: SocketAddr) -> Result<Self, Error>
pub async fn connect(addr: SocketAddr) -> Result<Self, Error>
Create a new UDP stream connected to the specified address.
This function will create a new UDP socket and attempt to connect it to
the addr
provided. The returned future will be resolved once the
stream has successfully connected, or it will return an error if one
occurs.
pub fn peer_addr(&self) -> Result<SocketAddr>
pub fn local_addr(&self) -> Result<SocketAddr>
pub fn shutdown(&self)
Trait Implementations
sourceimpl AsyncWrite for UdpStream
impl AsyncWrite for UdpStream
sourcefn 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 more
sourcefn poll_flush(self: Pin<&mut Self>, _cx: &mut Context<'_>) -> Poll<Result<()>>
fn poll_flush(self: Pin<&mut Self>, _cx: &mut Context<'_>) -> Poll<Result<()>>
Attempts to flush the object, ensuring that any buffered data reach their destination. Read more
sourcefn poll_shutdown(
self: Pin<&mut Self>,
_cx: &mut Context<'_>
) -> Poll<Result<()>>
fn poll_shutdown(
self: Pin<&mut Self>,
_cx: &mut Context<'_>
) -> Poll<Result<()>>
Initiates or attempts to shut down this writer, returning success when the I/O connection has completely shut down. Read more
sourcefn poll_write_vectored(
self: Pin<&mut Self>,
cx: &mut Context<'_>,
bufs: &[IoSlice<'_>]
) -> Poll<Result<usize, Error>>
fn poll_write_vectored(
self: Pin<&mut Self>,
cx: &mut Context<'_>,
bufs: &[IoSlice<'_>]
) -> Poll<Result<usize, Error>>
Like poll_write
, except that it writes from a slice of buffers. Read more
sourcefn is_write_vectored(&self) -> bool
fn is_write_vectored(&self) -> bool
Determines if this writer has an efficient poll_write_vectored
implementation. Read more
Auto Trait Implementations
impl RefUnwindSafe for UdpStream
impl Send for UdpStream
impl Sync for UdpStream
impl Unpin for UdpStream
impl UnwindSafe for UdpStream
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more