dust_devil_core/lib.rs
1//! Shared sources used in the dust-devil socks5 server and monitoring clients for implementing the
2//! Sandstorm monitoring protocol.
3//!
4//! # The Sandstorm monitoring protocol
5//! The dust-devil server uses a custom monitoring protocol called Sandstorm. Sandstorm is a TCP
6//! protocol that is partly a request-response protocol, and partly a server-side stream of events.
7//! A better description of the protocol is provided in the
8//! [sandstorm_protocol.txt](https://github.com/ThomasMiz/dust-devil/blob/main/dust-devil-core/sandstorm_protocol.txt)
9//! file.
10//!
11//! The client can request actions to the server, such as adding or removing users, getting
12//! metrics, shutting down, etc. The server will then perform these actions and send responses back
13//! to the client indicating their results.
14//!
15//! This "stream of events" can be enabled by the client, and while enabled the server will send
16//! asynchronous events to the client. These events can be used, for example, as logging (in fact,
17//! if logging is enabled in the dust-devil server, logs are just a text representation of the
18//! events).
19//!
20//! # This crate
21//! This crate contains common files used for serializing and deserializing requests and responses
22//! for the Sandstorm protocol from raw bytes. All serializers and deserializers are prepared to
23//! receive any type implementing [`AsyncRead`][tokio::io::AsyncRead] or
24//! [`AsyncWrite`][tokio::io::AsyncWrite] from [`tokio::io`] and are async.
25//!
26//! All the serializing revolves around the [`ByteRead`][serialize::ByteRead] and
27//! [`ByteWrite`][serialize::ByteWrite] traits. These are defined in the [`serialize`] module and
28//! define async `read` and `write` functions.
29
30pub mod buffer_size;
31pub mod logging;
32pub mod sandstorm;
33pub mod serialize;
34pub mod socks5;
35pub mod u8_repr_enum;
36pub mod users;