#coap #iot #networking #wasm #heap-allocation #no-std

no-std toad-array

Array trait used by the toad ecosystem to abstract over heap or heapless collections

12 releases (6 breaking)

1.0.0 May 22, 2023
0.8.0 May 11, 2023
0.5.0 Mar 31, 2023

#26 in #coap

Download history 47/week @ 2024-02-26 5/week @ 2024-03-04 19/week @ 2024-03-11 2/week @ 2024-03-18 32/week @ 2024-04-01 233/week @ 2024-04-08 27/week @ 2024-04-15

292 downloads per month
Used in 5 crates

MIT/Apache

20KB
281 lines

A CoAP implementation that strives to power client- and server-side CoAP in any language & any environment.

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.

CoAP vs HTTP

CoAP provides a high performance + low latency alternative to HTTP that uses much of the same terminology and semantics.

In CoAP, you'll find familiar things like verbs (GET, POST, PUT, DELETE), headers (aka. Options) and status code (4.04 NOT FOUND) but you also have access to some extra levers that let you customize behavior of requests and responses, such as "I don't need to know that you received this message."

The library

Contributing

  • There are examples provided in each library that demo some high (or low) level use-cases that this library aims to cover
  • The issues are a good place to start if you're interested in contributing directly. At this stage, the project issues are a living backlog of work-to-be-done before stabilizing and promoting the repo.
  • You (contributor) should just make sure tests pass (cargo make test). I'll get the other CI steps to pass to make your contribution experience painless.
  • TODO: document architecture at a high level

Setup

  • install the rust language
  • clone this repo git clone git@github.com:toad-lib/toad
  • install cargo-make cargo install cargo-make
  • try running an example cd toad; cargo run --example server

How we define success

  • toad is significantly faster and lower latency than comparable HTTP libraries
  • toad answers questions like "what is coap?" and "why should i care?"
  • toad has frontends available in major ecosystems (Android, iOS, Node)
  • toad is fully usable on constrained bare metal devices in both server & client roles

lib.rs:

This microcrate contains the Array trait used by the toad CoAP runtime / ecosystem.

The Array trait defines common operations used with heap-allocated collections like Vec but is also implemented for tinyvec::ArrayVec allowing for applications to be usable on platforms with or without heap allocation.

Dependencies

~265KB