iceoryx2_tunnel_backend/lib.rs
1// Copyright (c) 2025 Contributors to the Eclipse Foundation
2//
3// See the NOTICE file(s) distributed with this work for additional
4// information regarding copyright ownership.
5//
6// This program and the accompanying materials are made available under the
7// terms of the Apache Software License 2.0 which is available at
8// https://www.apache.org/licenses/LICENSE-2.0, or the MIT license
9// which is available at https://opensource.org/licenses/MIT.
10//
11// SPDX-License-Identifier: Apache-2.0 OR MIT
12
13#![no_std]
14
15//! Backend traits and types for tunneling `iceoryx2` services across hosts.
16//!
17//! This crate provides the trait abstractions necessary to implement custom
18//! communication backends that tunnel `iceoryx2` [`Service`](iceoryx2::service::Service)s
19//! between different hosts, networks, or domains. Implementers can create backends
20//! using various protocols (TCP, UDP, custom transports) while maintaining a
21//! consistent interface for the `iceoryx2` tunnel infrastructure.
22//!
23//! # Overview
24//!
25//! The crate defines a hierarchy of traits that together enable complete
26//! tunneling functionality:
27//!
28//! - [`Backend`](traits::Backend): Top-level trait combining discovery and relay factory capabilities
29//! - [`Discovery`](traits::Discovery): [`Service`](iceoryx2::service::Service) announcement and discovery across the backend
30//! - [`RelayFactory`](traits::RelayFactory): Factory for creating relay instances
31//! - [`RelayBuilder`](traits::RelayBuilder): Builder pattern for configuring relays
32//! - [`PublishSubscribeRelay`](traits::PublishSubscribeRelay): Bidirectional pub-sub data tunneling
33//! - [`EventRelay`](traits::EventRelay): Bidirectional event notification tunneling
34//!
35//! # Architecture
36//!
37//! A tunnel backend implementation consists of two main components:
38//!
39//! 1. **Discovery**: Announces local [`Service`](iceoryx2::service::Service)s to remote hosts and discovers
40//! [`Service`](iceoryx2::service::Service)s available on remote hosts, making them accessible as if they
41//! were local.
42//!
43//! 2. **Relays**: Handle the actual data transmission for [`Service`](iceoryx2::service::Service)s. Each service
44//! pattern (event, publish-subscribe) has its own relay type that manages
45//! bidirectional communication over the backend's transport mechanism.
46//!
47//! # Usage
48//!
49//! This crate is intended for developers implementing custom tunnel backends.
50//! End users typically interact with concrete backend implementations rather
51//! than using this crate directly.
52//!
53//! # Features
54//!
55//! This crate is `no_std` compatible and requires only the `alloc` crate.
56
57extern crate alloc;
58
59pub mod traits;
60pub mod types;