UdpTransport

Struct UdpTransport 

Source
pub struct UdpTransport<A: ToSocketAddrs> { /* private fields */ }
Expand description

Default CoAP transport as originally defined in RFC 7252. Likely this is what you want if you’re new to CoAP.

Implementations§

Source§

impl<A: ToSocketAddrs> UdpTransport<A>

Source

pub fn new(addresses: A) -> Self

Source

pub fn set_mtu(self, mtu: u32) -> Self

Manually set the MTU that will be used for block-wise transfer handling purposes.

Source

pub fn enable_multicast(self) -> Self

Source

pub fn set_multicast_default_ipv4_interface(self, interface: Ipv4Addr) -> Self

Source

pub fn set_multicast_default_ipv6_interface(self, interface: u32) -> Self

Source

pub fn add_multicast_join(self, join: MulticastGroupJoin) -> Self

Trait Implementations§

Source§

impl<A: ToSocketAddrs + Sync + Send> Transport for UdpTransport<A>

Source§

type Endpoint = SocketAddr

Source§

fn bind<'async_trait>( self, ) -> Pin<Box<dyn Future<Output = Result<BoxedFramedBinding<Self::Endpoint>, TransportError>> + Send + 'async_trait>>
where Self: 'async_trait,

Perform the binding, that is, begin accepting new data from this transport even if there isn’t yet a handler serving the data source yet. Note that this is not quite the same as TcpSocket::bind which requires a loop to accept the incoming connections. In our case, we expect a continuous async stream of (Packet, Endpoint) pairs which distinguish each individual socket. The transport impl is expected to spawn new tasks for each accepted source as necessary.

Auto Trait Implementations§

§

impl<A> Freeze for UdpTransport<A>
where A: Freeze,

§

impl<A> RefUnwindSafe for UdpTransport<A>
where A: RefUnwindSafe,

§

impl<A> Send for UdpTransport<A>
where A: Send,

§

impl<A> Sync for UdpTransport<A>
where A: Sync,

§

impl<A> Unpin for UdpTransport<A>
where A: Unpin,

§

impl<A> UnwindSafe for UdpTransport<A>
where A: UnwindSafe,

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 = Infallible

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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V