Crate toad

Crate toad 

Source
Expand description

toad is a Rust CoAP implementation that aims to be:

  • Platform-independent
  • Extensible
  • Approachable

§CoAP

CoAP is an application-level network protocol that copies the semantics of HTTP to an environment conducive to constrained devices. (weak hardware, small battery capacity, etc.)

This means that you can write and run two-way RESTful communication between devices very similarly to the networking semantics you are most likely very familiar with.

§Similarities to HTTP

CoAP has the same verbs and many of the same semantics as HTTP;

§Differences from HTTP

  • CoAP customarily sits on top of UDP (however the standard is in the process of being adapted to also run on TCP, like HTTP)
  • Because UDP is a “connectionless” protocol, it offers no guarantee of “conversation” between traditional client and server roles. All the UDP transport layer gives you is a method to listen for messages thrown at you, and to throw messages at someone. Owing to this, CoAP machines are expected to perform both client and server roles (or more accurately, sender and receiver roles)
  • While classes of status codes are the same (Success 2xx -> 2.xx, Client error 4xx -> 4.xx, Server error 5xx -> 5.xx), the semantics of the individual response codes differ.

Modules§

config
configuring runtime behavior
multicast
Helper constants and functions for creating multicast addresses
net
network abstractions
platform
platform configuration
req
requests
resp
responses
retry
customizable retrying of fallible operations
server
Server functionality
stdstd
std-only toad stuff
step
The Step trait
time
time abstractions

Macros§

_try
Specialized ? operator for use in step bodies, allowing early-exit for Result, Option<Result> and Option<nb::Result>.
exec_inner_step
Macro to execute inner steps, converting the Option<nb::Result<T, E>> to Option<T> by returning the inner step’s Errors & WouldBlock
log
Issue an Effect::Log

Enums§

ContentFormat
Content-Format

Traits§

ToCoapValue
Something that can be stored in a CoAP Option.