pub struct NullLocalEndpoint
where
Self: Send + Sync;
Expand description
A dummy endpoint implementation that doesn’t do anything. Useful for testing.
Trait Implementations§
Source§impl Debug for NullLocalEndpoint
impl Debug for NullLocalEndpoint
Source§impl LocalEndpoint for NullLocalEndpoint
impl LocalEndpoint for NullLocalEndpoint
Source§type SocketAddr = SocketAddr
type SocketAddr = 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).Source§type SocketError = Error
type SocketError = 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
.Source§type DefaultTransParams = StandardCoapConstants
type DefaultTransParams = StandardCoapConstants
The trait representing the default transmission parameters to use.
Source§type RemoteEndpoint = NullRemoteEndpoint
type RemoteEndpoint = NullRemoteEndpoint
The concrete type for a
RemoteEndpoint
associated with this local endpoint.Source§type LookupStream = Iter<IntoIter<<NullLocalEndpoint as LocalEndpoint>::SocketAddr>>
type LookupStream = Iter<IntoIter<<NullLocalEndpoint as LocalEndpoint>::SocketAddr>>
The concrete return type of the
lookup()
method.Source§type InboundContext = NullInboundContext
type InboundContext = NullInboundContext
Type used by closure that is passed into
send()
, representing the context for the
response.Source§type RespondableInboundContext = NullRespondableInboundContext
type RespondableInboundContext = NullRespondableInboundContext
Type used by closure that is passed into
receive()
, representing the context for
inbound requests.Source§fn scheme(&self) -> &'static str
fn scheme(&self) -> &'static str
Returns a string representing the scheme of the underlying transport.
For example, this could return
"coap"
, "coaps+sms"
, etc.Source§fn default_port(&self) -> u16
fn default_port(&self) -> u16
Returns the default port to use when the port is unspecified. This value
is typically defined by the scheme. Returns zero if port numbers are ignored
by the underlying technology.
Source§fn remote_endpoint<S, H, P>(
&self,
_addr: S,
_host: Option<H>,
_path: P,
) -> Self::RemoteEndpointwhere
S: ToSocketAddrs<SocketAddr = Self::SocketAddr, Error = Self::SocketError>,
H: Into<String>,
P: Into<RelRefBuf>,
fn remote_endpoint<S, H, P>(
&self,
_addr: S,
_host: Option<H>,
_path: P,
) -> Self::RemoteEndpointwhere
S: ToSocketAddrs<SocketAddr = Self::SocketAddr, Error = Self::SocketError>,
H: Into<String>,
P: Into<RelRefBuf>,
Constructs a new
RemoteEndpoint
instance for the given address, host, and path.Source§fn remote_endpoint_from_uri(
&self,
_uri: &Uri,
) -> Result<Self::RemoteEndpoint, Error>
fn remote_endpoint_from_uri( &self, _uri: &Uri, ) -> Result<Self::RemoteEndpoint, Error>
Constructs a new
RemoteEndpoint
instance for the given Uri.Source§fn lookup(
&self,
_hostname: &str,
_port: u16,
) -> Result<Self::LookupStream, Error>
fn lookup( &self, _hostname: &str, _port: u16, ) -> Result<Self::LookupStream, Error>
Method for asynchronously looking up the
Self::SocketAddr
instances for the
given hostname and port.Source§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,
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,
Auto Trait Implementations§
impl Freeze for NullLocalEndpoint
impl RefUnwindSafe for NullLocalEndpoint
impl Send for NullLocalEndpoint
impl Sync for NullLocalEndpoint
impl Unpin for NullLocalEndpoint
impl UnwindSafe for NullLocalEndpoint
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
Source§impl<T> LocalEndpointExt for Twhere
T: LocalEndpoint,
impl<T> LocalEndpointExt for Twhere
T: LocalEndpoint,
Source§fn send_as_stream<'a, S, R, SD>(
&'a self,
dest: S,
send_desc: SD,
) -> SendAsStream<'a, R>where
S: ToSocketAddrs<SocketAddr = Self::SocketAddr, Error = Self::SocketError> + 'a,
SD: SendDesc<Self::InboundContext, R> + 'a,
R: Send + 'a,
fn send_as_stream<'a, S, R, SD>(
&'a self,
dest: S,
send_desc: SD,
) -> SendAsStream<'a, R>where
S: ToSocketAddrs<SocketAddr = Self::SocketAddr, Error = Self::SocketError> + 'a,
SD: SendDesc<Self::InboundContext, R> + 'a,
R: Send + 'a,
Sends a message where multiple responses are expected, returned as a
SendAsStream
. Read moreSource§fn receive_as_stream<'a, F>(
&'a self,
handler: F,
) -> ReceiveAsStream<'a, Self, F>
fn receive_as_stream<'a, F>( &'a self, handler: F, ) -> ReceiveAsStream<'a, Self, F>
Version of
LocalEndpoint::receive
that handles more than one inbound message,
returning a crate::ReceiveAsStream
instead of a future. Read more