zenoh_ext/
lib.rs

1//
2// Copyright (c) 2023 ZettaScale Technology
3//
4// This program and the accompanying materials are made available under the
5// terms of the Eclipse Public License 2.0 which is available at
6// http://www.eclipse.org/legal/epl-2.0, or the Apache License, Version 2.0
7// which is available at https://www.apache.org/licenses/LICENSE-2.0.
8//
9// SPDX-License-Identifier: EPL-2.0 OR Apache-2.0
10//
11// Contributors:
12//   ZettaScale Zenoh Team, <zenoh@zettascale.tech>
13//
14
15//! [Zenoh](https://zenoh.io) /zeno/ is a stack that unifies data in motion, data at
16//! rest, and computations. It elegantly blends traditional pub/sub with geo-distributed
17//! storage, queries, and computations, while retaining a level of time and space efficiency
18//! that is well beyond any of the mainstream stacks.
19//!
20//! This crate provides components extending the core Zenoh functionalities.
21//!
22//! These components include
23//!
24//! # Serialization
25//!
26//! The base zenoh library allows to send/receive data as raw bytes payload. But in order to
27//! simplify the library's usability and, more importantly, to ensure interoperability
28//! between zenoh-based applications, this crate provides serialization/deserialization
29//! functionalities.
30//!
31//! The key functions are [`z_serialize`] and [`z_deserialize`] that allows to
32//! serialize/deserialize any data structure implementing the [`Serialize`] and
33//! [`Deserialize`] traits respectively.
34//!
35//! # Advanced Pub/Sub
36//!
37//! The [`AdvancedPublisher`] and [`AdvancedSubscriber`] provide advanced pub/sub
38//! functionalities, including support for message history, recovery, and more.
39#[cfg(feature = "unstable")]
40mod advanced_cache;
41#[cfg(feature = "unstable")]
42mod advanced_publisher;
43#[cfg(feature = "unstable")]
44mod advanced_subscriber;
45#[cfg(feature = "unstable")]
46pub mod group;
47#[cfg(feature = "unstable")]
48mod publication_cache;
49#[cfg(feature = "unstable")]
50mod publisher_ext;
51#[cfg(feature = "unstable")]
52mod querying_subscriber;
53mod serialization;
54#[cfg(feature = "unstable")]
55mod session_ext;
56#[cfg(feature = "unstable")]
57mod subscriber_ext;
58
59#[cfg(feature = "internal")]
60pub use crate::serialization::VarInt;
61pub use crate::serialization::{
62    z_deserialize, z_serialize, Deserialize, Serialize, ZDeserializeError, ZDeserializer,
63    ZReadIter, ZSerializer,
64};
65#[cfg(feature = "unstable")]
66#[allow(deprecated)]
67pub use crate::{
68    advanced_cache::{CacheConfig, RepliesConfig},
69    advanced_publisher::{
70        AdvancedPublicationBuilder, AdvancedPublisher, AdvancedPublisherBuilder,
71        AdvancedPublisherDeleteBuilder, AdvancedPublisherPutBuilder, MissDetectionConfig,
72    },
73    advanced_subscriber::{
74        AdvancedSubscriber, AdvancedSubscriberBuilder, HistoryConfig, Miss, RecoveryConfig,
75        SampleMissHandlerUndeclaration, SampleMissListener, SampleMissListenerBuilder,
76    },
77    publication_cache::{PublicationCache, PublicationCacheBuilder},
78    publisher_ext::AdvancedPublisherBuilderExt,
79    querying_subscriber::{
80        ExtractSample, FetchingSubscriber, FetchingSubscriberBuilder, KeySpace, LivelinessSpace,
81        QueryingSubscriberBuilder, UserSpace,
82    },
83    session_ext::SessionExt,
84    subscriber_ext::{AdvancedSubscriberBuilderExt, SubscriberBuilderExt, SubscriberForward},
85};