Skip to main content

DatagramSender

Struct DatagramSender 

Source
pub struct DatagramSender<H: SendDatagram<B>, B: Buf> { /* private fields */ }
Expand description

Gives the ability to send datagrams.

Implementations§

Source§

impl<H, B> DatagramSender<H, B>
where H: SendDatagram<B>, B: Buf,

Source

pub fn send_datagram(&mut self, data: B) -> Result<(), SendDatagramError>

Sends a datagram

Trait Implementations§

Source§

impl<H, B> ConnectionState for DatagramSender<H, B>
where H: SendDatagram<B>, B: Buf,

Source§

fn shared_state(&self) -> &SharedState

Get the shared state
Source§

fn get_conn_error(&self) -> Option<ErrorOrigin>

Get the connection error if the connection is in error state because of another task Read more
Source§

fn set_conn_error(&self, error: ErrorOrigin) -> ErrorOrigin

tries to set the connection error
Source§

fn set_conn_error_and_wake<T>(&self, error: T) -> ErrorOrigin
where T: Into<ErrorOrigin>,

set the connection error and wake the connection
Source§

fn settings(&self) -> Cow<'_, Settings>

Get the settings
Source§

fn set_closing(&self)

Set the connection to closing
Source§

fn is_closing(&self) -> bool

Check if the connection is closing
Source§

fn set_settings(&self, settings: Settings)

Set the settings
Source§

fn waker(&self) -> &AtomicWaker

Returns the waker for the connection
Source§

impl<H: Debug + SendDatagram<B>, B: Debug + Buf> Debug for DatagramSender<H, B>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<H, B> !RefUnwindSafe for DatagramSender<H, B>

§

impl<H, B> !UnwindSafe for DatagramSender<H, B>

§

impl<H, B> Freeze for DatagramSender<H, B>
where H: Freeze, PhantomData<B>: Freeze,

§

impl<H, B> Send for DatagramSender<H, B>
where H: Send, PhantomData<B>: Send,

§

impl<H, B> Sync for DatagramSender<H, B>
where H: Sync, PhantomData<B>: Sync,

§

impl<H, B> Unpin for DatagramSender<H, B>
where H: Unpin, PhantomData<B>: Unpin,

§

impl<H, B> UnsafeUnpin for DatagramSender<H, B>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.