dstar_gateway_core/
lib.rs

1//! Sans-io core for the `dstar-gateway` D-STAR reflector library.
2//!
3//! This crate is **runtime-agnostic and I/O-free**. It contains the
4//! wire-format codecs, the typestate session machines, and the
5//! supporting types and errors. The async (tokio) and blocking shells
6//! live in the sibling [`dstar-gateway`] and [`dstar-gateway-server`]
7//! crates respectively.
8//!
9//! See [`crate::types`] for validated primitives, [`crate::header`]
10//! for the D-STAR radio header, [`crate::voice`] for voice frame
11//! types, [`crate::hosts`] for the host file parser, and
12//! [`crate::error`] for the error hierarchy.
13//!
14//!
15//! [`dstar-gateway`]: https://github.com/swiftraccoon/dstar-gateway/tree/main/dstar-gateway
16//! [`dstar-gateway-server`]: https://github.com/swiftraccoon/dstar-gateway/tree/main/dstar-gateway-server
17
18pub mod codec;
19pub mod dprs;
20pub mod error;
21pub mod header;
22pub mod hosts;
23pub mod session;
24pub mod slowdata;
25pub mod types;
26pub mod validator;
27pub mod voice;
28
29pub use dprs::{DprsError, DprsReport, Latitude, Longitude, compute_crc, encode_dprs, parse_dprs};
30pub use error::{
31    DExtraError, DPlusError, DcsError, EncodeError, Error, IoOperation, ProtocolError, StateError,
32    TimeoutError,
33};
34pub use header::{DStarHeader, ENCODED_LEN, crc_ccitt};
35pub use hosts::{HostEntry, HostFile};
36pub use session::client::{
37    AnySession, Authenticated, ClientState, ClientStateKind, Closed, Configured, Connected,
38    Connecting, DExtra, DPlus, Dcs, DisconnectReason, Disconnecting, Event, Failed, Missing,
39    NoAuthRequired, Protocol, Provided, Session, SessionBuilder, SessionCore, VoiceEndReason,
40};
41pub use session::server::{
42    ClientRejectedReason, ForwardableFrame, ServerEvent, ServerSession, ServerSessionCore,
43};
44pub use session::{Driver, Transmit};
45pub use slowdata::{
46    MAX_MESSAGE_LEN, SlowDataAssembler, SlowDataBlock, SlowDataBlockKind, SlowDataError,
47    SlowDataText, SlowDataTextCollector, descramble, encode_text_message, scramble,
48};
49pub use types::{
50    BandLetter, Callsign, Module, ProtocolKind, ReflectorCallsign, StreamId, Suffix, TypeError,
51};
52pub use validator::{
53    AuthHostSkipReason, CallsignField, Diagnostic, DiagnosticSink, NullSink, TracingSink, VecSink,
54};
55pub use voice::{AMBE_SILENCE, DSTAR_SYNC_BYTES, VoiceFrame};
56
57// `proptest` is a dev-dependency used only in the integration test
58// suites under `tests/`. The lib test crate compiles with dev-deps in
59// scope too, so we acknowledge it here to keep
60// `-D unused-crate-dependencies` happy.
61#[cfg(test)]
62use proptest as _;
63
64// `trybuild` is a dev-dependency used by the compile-fail test harness;
65// acknowledged here so the lint pass doesn't fire.
66#[cfg(test)]
67use trybuild as _;