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>
impl<A: ToSocketAddrs> UdpTransport<A>
pub fn new(addresses: A) -> Self
Sourcepub fn set_mtu(self, mtu: u32) -> Self
pub fn set_mtu(self, mtu: u32) -> Self
Manually set the MTU that will be used for block-wise transfer handling purposes.
pub fn enable_multicast(self) -> Self
pub fn set_multicast_default_ipv4_interface(self, interface: Ipv4Addr) -> Self
pub fn set_multicast_default_ipv6_interface(self, interface: u32) -> Self
pub fn add_multicast_join(self, join: MulticastGroupJoin) -> Self
Trait Implementations§
Source§impl<A: ToSocketAddrs + Sync + Send> Transport for UdpTransport<A>
impl<A: ToSocketAddrs + Sync + Send> Transport for UdpTransport<A>
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,
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> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more