Struct tokio_udp_framed::UdpFramedSend[][src]

pub struct UdpFramedSend<T, C> { /* fields omitted */ }

A Sink of frames encoded for udp.

Implementations

impl<T, C> UdpFramedSend<T, C> where
    T: Borrow<UdpSocket>, 
[src]

pub fn new(socket: T, codec: C) -> UdpFramedSend<T, C>[src]

Create a new UdpFramed backed by the given socket and codec.

See struct level documentation for more details.

pub fn get_ref(&self) -> &UdpSocket[src]

Returns a reference to the underlying I/O stream wrapped by Framed.

Note

Care should be taken to not tamper with the underlying stream of data coming in as it may corrupt the stream of frames otherwise being worked with.

pub fn encoder(&self) -> &C[src]

Returns a reference to the underlying codec wrapped by Framed.

Note that care should be taken to not tamper with the underlying codec as it may corrupt the stream of frames otherwise being worked with.

pub fn encoder_mut(&mut self) -> &mut C[src]

Returns a mutable reference to the underlying codec wrapped by UdpFramed.

Note that care should be taken to not tamper with the underlying codec as it may corrupt the stream of frames otherwise being worked with.

pub fn into_inner(self) -> T[src]

Consumes the Framed, returning its underlying I/O stream.

Trait Implementations

impl<T, C> Debug for UdpFramedSend<T, C> where
    T: Borrow<UdpSocket>,
    C: Debug
[src]

impl<T, I, U> Sink<(I, SocketAddr)> for UdpFramedSend<T, U> where
    T: Borrow<UdpSocket>,
    U: Encoder<I>,
    U::Error: From<Error>, 
[src]

type Error = U::Error

The type of value produced by the sink when an error occurs.

impl<'__pin, T, C> Unpin for UdpFramedSend<T, C> where
    __Origin<'__pin, T, C>: Unpin
[src]

Auto Trait Implementations

impl<T, C> RefUnwindSafe for UdpFramedSend<T, C> where
    C: RefUnwindSafe,
    T: RefUnwindSafe
[src]

impl<T, C> Send for UdpFramedSend<T, C> where
    C: Send,
    T: Send
[src]

impl<T, C> Sync for UdpFramedSend<T, C> where
    C: Sync,
    T: Sync
[src]

impl<T, C> UnwindSafe for UdpFramedSend<T, C> where
    C: UnwindSafe,
    T: UnwindSafe
[src]

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, Item> SinkExt<Item> for T where
    T: Sink<Item> + ?Sized
[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.