rtci-shared
Shared types of a sans-I/O WebRTC stack: marshalling traits, transport context, replay detection, the stream transport interface. 15 public modules, 97 items at 0.5.0.
cargo add [email protected] · crates.io · docs.rs · README on GitHub· MSRV 1.89
README
What every crate of the workspace shares: the Marshal / Unmarshal / MarshalSize traits, the common error type, TransportContext and the tagged message types that carry a datagram with its addresses, replay detection, network interface listing, and the stream transport interface (stream): connection ids, the commands a driver carries out, RFC 4571 and TURN framing of arbitrarily segmented reads, an optional TLS layer and back-pressure.
Specifications
- RFC 4571, framing RTP and RTCP over connection-oriented transport
- RFC 8656 section 11.5, ChannelData framing over TCP
- RFC 8305, Happy Eyeballs, as the stream interface's connection race uses it
Clause-by-clause status, with the test that proves each clause: rfc4571, rfc8305.
Use
Other crates use it directly; an application meets it as rtci::shared (the root crate re-exports it): TaggedBytesMut and TransportContext in its event loop, and stream::{StreamCommand, StreamEvent} when it drives the engine's TCP. Features: marshal, replay, ifaces (all default).
Sans-I/O
Types and codecs only. ifaces lists the host's interfaces when asked; nothing else touches the operating system or reads a clock.
Licence
Licensed under either of the MIT licence or the Apache License, Version 2.0, at your option.
This crate is part of the rtci workspace, which descends from webrtc-rs/rtc and is developed independently; FORK.md lists what it carries over upstream. Upstream's licence and copyright notices are retained.
rtci_shared
Shared types and utilities for the Sans-I/O WebRTC stack.
rtci_shared::ifacescfg(feature = "ifaces")
Local network interface enumeration, used to gather ICE host candidates.
rtci_shared::ifaces::ffi
Platform-specific interface enumeration (FFI into the OS).
rtci_shared::marshalcfg(feature = "marshal")
The wire-format traits every protocol codec in the stack implements.
rtci_shared::replay_detectorcfg(feature = "replay")
Replay protection for sequence-numbered packets, as DTLS and SRTP require.
rtci_shared::error
The crate-wide error type shared by every protocol in the stack.
rtci_shared::serde
serde helpers for types that have no natural serialized form, such as std::time::Instant.
rtci_shared::serde::instant_to_epoch
Serializes a SystemInstant as epoch time in milliseconds, an f64 with sub-millisecond precision: W3C stats timestamps are DOMHighResTimeStamps, milliseconds that "SHOULD be accurate to 5 microseconds".
rtci_shared::stream
Stream transports (TCP, and TLS over TCP) for a sans-I/O engine.
rtci_shared::stream::happy_eyeballs
Happy Eyeballs (RFC 8305) for a sans-I/O engine: the order in which a server's addresses are tried and when the next attempt starts. The driver resolves names (StreamCommand::Resolve), answering both families at once (StreamEvent::Resolved) or each as it arrives (StreamEvent::ResolvedFamily); the engine sorts and staggers the attempts with HappyEyeballs and keeps the first that …
rtci_shared::stream::nat64
NAT64 for the Happy Eyeballs engine on an IPv6-only network (RFC 8305 section 7, RFC 8445 section 5.1.1.2): the prefix the network's NAT64 uses is discovered with RFC 7050 (the AAAA records of IPV4ONLY_ARPA, which a DNS64 resolver synthesizes from its well-known IPv4 addresses), and IPv4 addresses are written into IPv6 ones with that prefix as RFC 6052 section 2.2 has it.
rtci_shared::tcp_framing
TCP framing utilities for ICE over TCP (RFC 4571/RFC 6544).
rtci_shared::time
Conversions between monotonic, Unix and NTP time.
rtci_shared::turn_framing
Splitting a TURN byte stream back into messages (RFC 8656 §12.5).
rtci_shared::util
Small shared helpers: packet demultiplexing predicates and random-string generation.
Generated from the sources of rtci-shared 0.5.0 at its release tag. Items made by macros and methods are on docs.rs.