[−][src]Struct coap::server::CoAPServer
Methods
impl CoAPServer
[src]
pub fn new<A: ToSocketAddrs>(addr: A) -> Result<CoAPServer>
[src]
Creates a CoAP server listening on the given address.
pub fn handle<H: CoAPHandler + 'static>(
&mut self,
handler: H
) -> Result<(), CoAPServerError>
[src]
&mut self,
handler: H
) -> Result<(), CoAPServerError>
Starts handling requests with the handler
pub fn stop(&mut self)
[src]
Stop the server.
pub fn set_worker_num(&mut self, worker_num: usize)
[src]
Set the number of threads for handling requests
pub fn update_resource(
&mut self,
path: &str,
payload: Vec<u8>
) -> Result<(), CoAPServerError>
[src]
&mut self,
path: &str,
payload: Vec<u8>
) -> Result<(), CoAPServerError>
Update the resource asynchronously, like PUT method in client
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.
Trait Implementations
impl Drop for CoAPServer
[src]
Auto Trait Implementations
impl Send for CoAPServer
impl !Sync for CoAPServer
Blanket Implementations
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From for T
[src]
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = !
🔬 This is a nightly-only experimental API. (
try_from
)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> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,