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#[cfg(feature = "unstable")]
59mod utils;
60
61#[cfg(feature = "internal")]
62pub use crate::serialization::VarInt;
63pub use crate::serialization::{
64    z_deserialize, z_serialize, Deserialize, Serialize, ZDeserializeError, ZDeserializer,
65    ZReadIter, ZSerializer,
66};
67#[cfg(feature = "unstable")]
68#[allow(deprecated)]
69pub use crate::{
70    advanced_cache::{CacheConfig, RepliesConfig},
71    advanced_publisher::{
72        AdvancedPublicationBuilder, AdvancedPublisher, AdvancedPublisherBuilder,
73        AdvancedPublisherDeleteBuilder, AdvancedPublisherPutBuilder, MissDetectionConfig,
74    },
75    advanced_subscriber::{
76        AdvancedSubscriber, AdvancedSubscriberBuilder, HistoryConfig, Miss, RecoveryConfig,
77        SampleMissHandlerUndeclaration, SampleMissListener, SampleMissListenerBuilder,
78    },
79    publication_cache::{PublicationCache, PublicationCacheBuilder},
80    publisher_ext::AdvancedPublisherBuilderExt,
81    querying_subscriber::{
82        ExtractSample, FetchingSubscriber, FetchingSubscriberBuilder, KeySpace, LivelinessSpace,
83        QueryingSubscriberBuilder, UserSpace,
84    },
85    session_ext::SessionExt,
86    subscriber_ext::{AdvancedSubscriberBuilderExt, SubscriberBuilderExt, SubscriberForward},
87};