Struct NullLocalEndpoint

Source
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
where Self: Send + Sync,

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl LocalEndpoint for NullLocalEndpoint

Source§

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

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

The trait representing the default transmission parameters to use.
Source§

type RemoteEndpoint = NullRemoteEndpoint

The concrete type for a RemoteEndpoint associated with this local endpoint.
Source§

type LookupStream = Iter<IntoIter<<NullLocalEndpoint as LocalEndpoint>::SocketAddr>>

The concrete return type of the lookup() method.
Source§

type InboundContext = NullInboundContext

Type used by closure that is passed into send(), representing the context for the response.
Source§

type RespondableInboundContext = NullRespondableInboundContext

Type used by closure that is passed into receive(), representing the context for inbound requests.
Source§

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

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::RemoteEndpoint
where 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>

Constructs a new RemoteEndpoint instance for the given Uri.
Source§

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,

Sends a message to remote_addr based on the criteria provided by send_desc. Read more
Source§

fn receive<'a, F>(&'a self, _handler: F) -> BoxFuture<'a, Result<(), Error>>
where F: FnMut(&Self::RespondableInboundContext) -> Result<(), Error> + 'a,

Receives a single request and runs the given handler on it once. Read more

Auto Trait Implementations§

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> LocalEndpointExt for T
where 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,

Sends a message where multiple responses are expected, returned as a SendAsStream. Read more
Source§

fn receive_as_stream<'a, F>( &'a self, handler: F, ) -> ReceiveAsStream<'a, Self, F>
where F: FnMut(&Self::RespondableInboundContext) -> Result<(), Error> + 'a + Clone + Unpin + Send,

Version of LocalEndpoint::receive that handles more than one inbound message, returning a crate::ReceiveAsStream instead of a future. Read more
Source§

fn receive_loop<'a, F>( &'a self, handler: F, ) -> Collect<ReceiveAsStream<'a, Self, F>, Error>
where F: FnMut(&Self::RespondableInboundContext) -> Result<(), Error> + 'a + Clone + Unpin + Send,

Convenience method for implementing a receive loop. Read more
Source§

fn receive_loop_arc<'a, F>( self: Arc<Self>, handler: F, ) -> ArcGuard<Self, Collect<ReceiveAsStream<'a, Self, F>, Error>>
where F: FnMut(&Self::RespondableInboundContext) -> Result<(), Error> + 'a + Clone + Send + Unpin, Self: 'a,

Version of LocalEndpointExt::receive_loop which consumes and holds an Arc<Self>. Read more
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