pub struct UdpTransmitter<S, const MTU: usize> { /* private fields */ }

Implementations§

source§

impl<S, const MTU: usize> UdpTransmitter<S, MTU>where S: UdpSocket,

source

pub fn new(destination_port: u16) -> Self

Creates a transmitter

Panics

This function panics if MTU is less than 29. 29 bytes is the minimum MTU required to contain a header, transfer CRC, and one byte of payload in each frame.

Trait Implementations§

source§

impl<C, S, const MTU: usize> Transmitter<C> for UdpTransmitter<S, MTU>where C: Clock, S: UdpSocket,

§

type Transport = UdpTransport

The transport that this transmitter works with
§

type Driver = S

The driver type that this transmitter uses to send frames
§

type Error = Error<<S as UdpSocket>::Error>

An error type Read more
source§

fn push<A>( &mut self, transfer: Transfer<A, C::Instant, Self::Transport>, clock: &mut C, socket: &mut S ) -> Result<(), Self::Error>where A: AsRef<[u8]>,

Starts the process of sending an outgoing transfer Read more
source§

fn flush(&mut self, _clock: &mut C, _socket: &mut S) -> Result<(), Self::Error>

Attempts to send all queued outgoing frames Read more
source§

fn mtu(&self) -> usize

Returns the maximum transmission unit of this transport, in bytes Read more

Auto Trait Implementations§

§

impl<S, const MTU: usize> RefUnwindSafe for UdpTransmitter<S, MTU>where S: RefUnwindSafe,

§

impl<S, const MTU: usize> Send for UdpTransmitter<S, MTU>where S: Send,

§

impl<S, const MTU: usize> Sync for UdpTransmitter<S, MTU>where S: Sync,

§

impl<S, const MTU: usize> Unpin for UdpTransmitter<S, MTU>where S: Unpin,

§

impl<S, const MTU: usize> UnwindSafe for UdpTransmitter<S, MTU>where S: UnwindSafe,

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

const: unstable · source§

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

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

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

const: unstable · 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 Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

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

Performs the conversion.
source§

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

§

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

The type returned in the event of a conversion error.
const: unstable · source§

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

Performs the conversion.