[−][src]Struct coap::client::CoAPClient
Methods
impl CoAPClient
[src]
pub 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.
pub fn new<A: ToSocketAddrs>(addr: A) -> Result<CoAPClient>
[src]
Create a CoAP client with the peer address.
pub fn get(url: &str) -> Result<CoAPResponse>
[src]
Execute a get request
pub fn get_with_timeout(url: &str, timeout: Duration) -> Result<CoAPResponse>
[src]
Execute a get request with the coap url and a specific timeout.
pub fn observe<H: FnMut(Packet) + Send + 'static>(
&mut self,
resource_path: &str,
handler: H
) -> Result<()>
[src]
&mut self,
resource_path: &str,
handler: H
) -> Result<()>
Observe a resource with the handler
pub fn unobserve(&mut self)
[src]
Stop observing
pub fn request_with_timeout(
url: &str,
timeout: Option<Duration>
) -> Result<CoAPResponse>
[src]
url: &str,
timeout: Option<Duration>
) -> Result<CoAPResponse>
Deprecated since 0.6.0:
please use get_with_timeout
instead
Execute a request with the coap url and a specific timeout. Default timeout is 5s.
pub fn request(url: &str) -> Result<CoAPResponse>
[src]
Deprecated since 0.6.0:
please use get
instead
Execute a request with the coap url.
pub fn send(&self, request: &CoAPRequest) -> Result<()>
[src]
Execute a request.
pub fn receive(&self) -> Result<CoAPResponse>
[src]
Receive a response.
pub fn set_receive_timeout(&self, dur: Option<Duration>) -> Result<()>
[src]
Set the receive timeout.
Trait Implementations
impl Drop for CoAPClient
[src]
Auto Trait Implementations
impl Send for CoAPClient
impl !Sync for CoAPClient
Blanket Implementations
impl<T> From for T
[src]
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
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>,