Struct coap::server::CoAPServer
source · pub struct CoAPServer { /* private fields */ }
Implementations
sourceimpl CoAPServer
impl CoAPServer
sourcepub fn new<A: ToSocketAddrs>(addr: A) -> Result<CoAPServer>
pub fn new<A: ToSocketAddrs>(addr: A) -> Result<CoAPServer>
Creates a CoAP server listening on the given address.
sourcepub fn handle<H: CoAPHandler + 'static>(
&mut self,
handler: H
) -> Result<(), CoAPServerError>
pub fn handle<H: CoAPHandler + 'static>(
&mut self,
handler: H
) -> Result<(), CoAPServerError>
Starts handling requests with the handler
sourcepub fn set_worker_num(&mut self, worker_num: usize)
pub fn set_worker_num(&mut self, worker_num: usize)
Set the number of threads for handling requests
sourcepub fn update_resource(
&mut self,
path: &str,
payload: Vec<u8>
) -> Result<(), CoAPServerError>
pub fn update_resource(
&mut self,
path: &str,
payload: Vec<u8>
) -> Result<(), CoAPServerError>
Update the resource asynchronously, like PUT method in client
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for CoAPServer
impl Send for CoAPServer
impl Sync for CoAPServer
impl Unpin for CoAPServer
impl !UnwindSafe for CoAPServer
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more