[−][src]Struct coap::server::Server
Implementations
impl<'a, HandlerRet> Server<'a, HandlerRet> where
HandlerRet: Future<Output = Option<CoapResponse>>, [src]
HandlerRet: Future<Output = Option<CoapResponse>>,
pub fn new<A: ToSocketAddrs>(addr: A) -> Result<Server<'a, HandlerRet>, Error>[src]
Creates a CoAP server listening on the given address.
pub async fn run<F: FnMut(CoapRequest<SocketAddr>) -> HandlerRet + Send + 'a, '_>(
&'_ mut self,
handler: F
) -> Result<(), Error>[src]
&'_ mut self,
handler: F
) -> Result<(), Error>
run the server.
pub fn socket_addr(&self) -> Result<SocketAddr>[src]
Return the local address that the server is listening on. This can be useful when starting a server on a random port as part of unit testing.
Auto Trait Implementations
impl<'a, HandlerRet> !RefUnwindSafe for Server<'a, HandlerRet>
impl<'a, HandlerRet> Send for Server<'a, HandlerRet>
impl<'a, HandlerRet> !Sync for Server<'a, HandlerRet>
impl<'a, HandlerRet> Unpin for Server<'a, HandlerRet>
impl<'a, HandlerRet> !UnwindSafe for Server<'a, HandlerRet>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T[src]
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.
pub 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>,