Struct tokio::net::udp::SendHalf[][src]

pub struct SendHalf(_);

The send half after split.

Use send_to or send to send datagrams.

Implementations

impl SendHalf[src]

pub fn reunite(self, other: RecvHalf) -> Result<UdpSocket, ReuniteError>[src]

Attempts to put the two “halves” of a UdpSocket back together and recover the original socket. Succeeds only if the two “halves” originated from the same call to UdpSocket::split.

pub async fn send_to(
    &mut self,
    buf: &[u8],
    target: &SocketAddr
) -> Result<usize>
[src]

Returns a future that sends data on the socket to the given address. On success, the future will resolve to the number of bytes written.

The future will resolve to an error if the IP version of the socket does not match that of target.

pub async fn send(&mut self, buf: &[u8]) -> Result<usize>[src]

Returns a future that sends data on the socket to the remote address to which it is connected. On success, the future will resolve to the number of bytes written.

The connect method will connect this socket to a remote address. The future will resolve to an error if the socket is not connected.

Trait Implementations

impl AsRef<UdpSocket> for SendHalf[src]

impl Debug for SendHalf[src]

Auto Trait Implementations

impl !RefUnwindSafe for SendHalf

impl Send for SendHalf

impl Sync for SendHalf

impl Unpin for SendHalf

impl !UnwindSafe for SendHalf

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.