[−][src]Struct async_coap::datagram::DatagramLocalEndpoint
Generic, datagram-based CoAP local endpoint implementation.
Methods
impl<US: AsyncDatagramSocket> DatagramLocalEndpoint<US>
[src]
pub fn new(socket: US) -> DatagramLocalEndpoint<US>
[src]
Creates a new DatagramLocalEndpoint
instance with the given AsyncDatagramSocket
and the standard scheme (coap:
) and default port (5683).
pub fn with_scheme_and_port(
socket: US,
scheme: &'static str,
default_port: u16
) -> DatagramLocalEndpoint<US>
[src]
socket: US,
scheme: &'static str,
default_port: u16
) -> DatagramLocalEndpoint<US>
Creates a new DatagramLocalEndpoint
instance with the given AsyncDatagramSocket
,
using the specified scheme and default port.
pub fn socket(&self) -> &US
[src]
Borrows a reference to the underlying socket.
Trait Implementations
impl<US: AsyncDatagramSocket> LocalEndpoint for DatagramLocalEndpoint<US>
[src]
type SocketAddr = US::SocketAddr
The SocketAddr
type to use with this local endpoint. This is usually simply std::net::SocketAddr
, but may be different in some cases (like for CoAP-SMS endpoints). Read more
type SocketError = US::Error
The error type associated with errors generated by socket and address-lookup operations. Typically, this is std::io::Error
, but it may be different if Self::SocketAddr
isn't std::net::SocketAddr
. Read more
type DefaultTransParams = StandardCoapConstants
The trait representing the default transmission parameters to use.
type LookupStream = Iter<IntoIter<Self::SocketAddr>>
The concrete return type of the lookup()
method.
type RespondableInboundContext = DatagramRespondableInboundContext<Self::SocketAddr>
Type used by closure that is passed into receive()
, representing the context for inbound requests. Read more
type InboundContext = DatagramInboundContext<Self::SocketAddr>
Type used by closure that is passed into send()
, representing the context for the response. Read more
type RemoteEndpoint = DatagramRemoteEndpoint<US>
The concrete type for a RemoteEndpoint
associated with this local endpoint.
fn remote_endpoint<S, H, P>(
&self,
addr: S,
host: Option<H>,
path: P
) -> Self::RemoteEndpoint where
S: ToSocketAddrs<SocketAddr = Self::SocketAddr, Error = Self::SocketError>,
H: Into<String>,
P: Into<RelRefBuf>,
[src]
&self,
addr: S,
host: Option<H>,
path: P
) -> Self::RemoteEndpoint where
S: ToSocketAddrs<SocketAddr = Self::SocketAddr, Error = Self::SocketError>,
H: Into<String>,
P: Into<RelRefBuf>,
fn remote_endpoint_from_uri(
&self,
uri: &Uri
) -> Result<Self::RemoteEndpoint, Error>
[src]
&self,
uri: &Uri
) -> Result<Self::RemoteEndpoint, Error>
fn send<'a, S, R, SD>(
&'a self,
dest: S,
send_desc: SD
) -> BoxFuture<'a, Result<R, Error>> where
S: ToSocketAddrs<SocketAddr = Self::SocketAddr, Error = Self::SocketError> + 'a,
SD: SendDesc<Self::InboundContext, R> + 'a,
R: Send + 'a,
[src]
&'a self,
dest: S,
send_desc: SD
) -> BoxFuture<'a, Result<R, Error>> where
S: ToSocketAddrs<SocketAddr = Self::SocketAddr, Error = Self::SocketError> + 'a,
SD: SendDesc<Self::InboundContext, R> + 'a,
R: Send + 'a,
fn receive<'a, F>(&'a self, handler: F) -> BoxFuture<'a, Result<(), Error>> where
F: FnMut(&Self::RespondableInboundContext) -> Result<(), Error> + 'a + Send,
[src]
F: FnMut(&Self::RespondableInboundContext) -> Result<(), Error> + 'a + Send,
fn scheme(&self) -> &'static str
[src]
fn default_port(&self) -> u16
[src]
fn lookup(&self, hostname: &str, port: u16) -> Result<Self::LookupStream, Error>
[src]
impl<US: Debug + AsyncDatagramSocket> Debug for DatagramLocalEndpoint<US> where
Self: Send + Sync,
[src]
Self: Send + Sync,
Auto Trait Implementations
impl<US> Send for DatagramLocalEndpoint<US>
impl<US> Unpin for DatagramLocalEndpoint<US>
impl<US> Sync for DatagramLocalEndpoint<US>
impl<US> RefUnwindSafe for DatagramLocalEndpoint<US> where
US: RefUnwindSafe,
US: RefUnwindSafe,
impl<US> UnwindSafe for DatagramLocalEndpoint<US> where
US: RefUnwindSafe,
US: RefUnwindSafe,
Blanket Implementations
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,