nautilus_network/transport/mod.rs
1// -------------------------------------------------------------------------------------------------
2// Copyright (C) 2015-2026 Nautech Systems Pty Ltd. All rights reserved.
3// https://nautechsystems.io
4//
5// Licensed under the GNU Lesser General Public License Version 3.0 (the "License");
6// You may not use this file except in compliance with the License.
7// You may obtain a copy of the License at https://www.gnu.org/licenses/lgpl-3.0.en.html
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14// -------------------------------------------------------------------------------------------------
15
16//! Transport abstraction layer for WebSocket backends.
17//!
18//! Defines the backend-agnostic surface that higher layers in `nautilus-network`
19//! consume (the reconnecting client, auth tracker, subscription manager, Python
20//! bindings, and adapter crates):
21//!
22//! - [`Message`]: neutral WebSocket message enum.
23//! - [`TransportError`]: neutral error type.
24//! - [`WsTransport`]: `Stream` plus `Sink` trait for backend implementations.
25//!
26//! The `tokio-tungstenite` backend is always compiled (its conversions and adapter
27//! live in [`tungstenite`]). The `sockudo-ws` backend is gated behind the
28//! `transport-sockudo` feature and lives in the `sockudo` submodule; when enabled
29//! it can be selected at runtime via `WebSocketConfig.backend`.
30
31pub mod error;
32pub mod message;
33pub mod stream;
34pub mod tungstenite;
35
36#[cfg(feature = "transport-sockudo")]
37pub mod sockudo;
38
39pub use error::TransportError;
40pub use message::{CloseFrame, Message};
41pub use stream::{BoxedWsTransport, WsTransport};