Skip to main content

CommonLibrary/Transport/
mod.rs

1//! # Transport Layer
2//!
3//! This module defines the transport-layer abstraction that enables
4//! communication between CodeEditorLand components through various mechanisms
5//! (gRPC, IPC, WASM) using a unified Strategy pattern interface.
6//!
7//! ## Architecture
8//!
9//! - [`TransportStrategy`] - Core trait all transports must implement
10//! - [`Registry::TransportRegistry`] - Dynamic transport selection and
11//!   management
12//! - [`UnifiedRequest`] / [`UnifiedResponse`] - Common message format
13//! - [`TransportError`] - Unified error taxonomy
14//! - [`TransportConfig`] - Configuration structures
15//!
16//! ## Sub-modules
17//!
18//! - [`Common`] - Shared types and utilities
19//! - [`gRPC`] - gRPC transport implementation
20//! - [`IPC`] - IPC (Unix sockets/Named pipes) implementation
21//! - [`WASM`] - WebAssembly/WebWorker implementation
22//! - [`Registry`] - Transport registry and selection
23//! - [`Metrics`] - Metrics collection and monitoring
24//! - [`Retry`] - Retry strategies with backoff
25//! - [`CircuitBreaker`] - Circuit breaker pattern
26//! - [`DTO`] - Data Transfer Objects
27//!
28//! ## Usage
29//!
30//! Components should use the transport abstraction to remain
31//! transport-agnostic:
32//!
33//! ```rust
34//! use common_common::transport::{TransportStrategy, UnifiedRequest};
35//!
36//! async fn send_request(
37//! 	transport:&mut dyn TransportStrategy,
38//! 	method:&str,
39//! 	payload:Vec<u8>,
40//! ) -> Result<Vec<u8>, TransportError> {
41//! 	let request = UnifiedRequest::new(method, payload);
42//! 	let response = transport.send_request(request).await?;
43//! 	Ok(response.payload)
44//! }
45//! ```
46
47// --- Core Trait and Types ---
48pub mod TransportStrategy;
49
50pub mod TransportError;
51
52pub mod UnifiedRequest;
53
54pub mod UnifiedResponse;
55
56pub mod TransportConfig;
57
58pub mod Common;