Expand description
rusty_esp_core — the shared vocabulary of the Janus ESP family.
Every Janus package (rusty_esp_audio, rusty_esp_image, rusty_esp_video,
rusty_esp_signal, rusty_esp_iroh, rusty_esp_mid) speaks these types at
its boundary, so a camera frame from one crate flows into an encoder in
another and onto the mesh in a third with no conversion and no copy.
What lives here, and the rule that keeps it small:
| Module | Holds | Rule |
|---|---|---|
time | Micros, a monotonic device timestamp; WallOffset, the host’s device→wall mapping with its error bound | value type, no clock |
error | Error, one Copy error for the family | no String, no alloc |
frame | Frame, a borrowed image/video frame | planes over caller memory |
pcm | PcmBlock, a borrowed interleaved PCM block | same |
capability | Manifest, what a device can do, canonically encoded; capability::ParsedManifest reads it back (alloc) | signed by rusty_esp_mid |
media | MediaPacket, a borrowed coded packet and its Codec | the shape every transport frames |
hal | Clock, Rng, Kv — the three seams every backend fills | traits only |
Nothing here is a driver, an allocator, a codec, or a product type. If a
type needs esp-hal, ESP-IDF, or a codec crate to define it, it does not
belong in this crate.
Why borrowed frames. The FFmpeg-shaped Vec<Vec<u8>>-per-frame model
is one-plus-N heap allocations per frame, returned by value. On a chip with
512 KB of SRAM that is the wrong shape at every level: allocation count,
ownership, and the trait signatures it forces. Janus frames are views over
memory the caller (a DMA ring, a static arena, a Vec on the host) already
owns. Sources write into caller buffers; encoders read views.
Feature ladder: std ⊃ alloc ⊃ core-only. The crate compiles for
riscv32imac-unknown-none-elf with --no-default-features.
Re-exports§
pub use capability::Capability;pub use capability::Chip;pub use capability::Declared;pub use capability::Manifest;pub use capability::Status;pub use error::Error;pub use frame::Frame;pub use frame::FrameMut;pub use frame::Geometry;pub use frame::PixelFormat;pub use frame::Plane;pub use frame::PlaneMut;pub use frame::Planes;pub use frame::PlanesMut;pub use hal::Clock;pub use hal::Kv;pub use hal::Rng;pub use media::Codec;pub use media::MediaPacket;pub use pcm::PcmBlock;pub use pcm::PcmFormat;pub use pcm::SampleFormat;pub use time::Micros;pub use time::WallOffset;
Modules§
- capability
- The capability manifest — what a device can do, stated honestly.
- error
- One small,
Copy, allocation-free error for the whole family. - frame
- Borrowed image and video frames.
- hal
- The three seams every Janus backend fills.
- media
- The one coded-packet type the media packages share.
- pcm
- Borrowed PCM audio blocks.
- prelude
- The names a sketch, a backend or a function crate wants in scope.
- time
- Monotonic device time.
Constants§
- FORMAT_
VERSION - The wire/format version of every canonical encoding this crate defines. Bump only with an accept-both reader already shipped (see the Janus plan, “changing a format others already read”).
- VERSION
- Crate version, for capability manifests and logs.