Struct coap::client::CoAPClient
[−]
[src]
pub struct CoAPClient { /* fields omitted */ }
Methods
impl CoAPClient
[src]
fn new_with_specific_source<A: ToSocketAddrs, B: ToSocketAddrs>(
bind_addr: A,
peer_addr: B
) -> Result<CoAPClient>
[src]
bind_addr: A,
peer_addr: B
) -> Result<CoAPClient>
Create a CoAP client with the specific source and peer address.
fn new<A: ToSocketAddrs>(addr: A) -> Result<CoAPClient>
[src]
Create a CoAP client with the peer address.
fn request_with_timeout(
url: &str,
timeout: Option<Duration>
) -> Result<CoAPResponse>
[src]
url: &str,
timeout: Option<Duration>
) -> Result<CoAPResponse>
Execute a request with the coap url and a specific timeout. Default timeout is 5s.
fn request(url: &str) -> Result<CoAPResponse>
[src]
Execute a request with the coap url.
fn send(&self, request: &CoAPRequest) -> Result<()>
[src]
Execute a request.
fn receive(&self) -> Result<CoAPResponse>
[src]
Receive a response.
fn set_receive_timeout(&self, dur: Option<Duration>) -> Result<()>
[src]
Set the receive timeout.