opentalk_types/
lib.rs

1// SPDX-FileCopyrightText: OpenTalk GmbH <mail@opentalk.eu>
2//
3// SPDX-License-Identifier: EUPL-1.2
4
5/*!
6Types and traits for the OpenTalk API and signaling protocols.
7
8This crate re-exports items from the crates where they are defined.
9All of these types can be used directly by importing the crate where they
10are defined directly. If many types are needed in a project, this crate
11could be the easier starting point though, because it serves as an index of
12which crates are available.
13
14# Crate features
15
16In order to allow efficient usage of the referenced items, this crate
17defines a flag for each of them. In addition some meta features are
18available that pull in a set of dependencies.
19
20## Meta features
21
22### Types meta features
23
24* **types-all** -
25  Enables all features that depend on specific datatype crates, indirectly by
26  enabling the **api** and the **signaling-all** features.
27* **api** -
28  Enables the **api-v1** feature.
29* **signaling-all** -
30  Enables all the signaling datatypes feature for all signaling modules.
31
32### Functionality meta features
33
34* **backend** -
35  Should be enabled when implementing the server side of either a signaling module
36  or an the API. Enables:
37  * the **backend** feature of each types crate
38  * **diesel**
39  * **kustos**
40  * **rand**
41  * **redis**
42  * **serde**
43* **frontend** -
44  Should be enabled when implemting the client side of either a signaling module
45  or the API. Enables:
46  * the **frontend** feature of each types crate
47  * **serde**
48
49## Type features
50
51* **api-v1** -
52  Re-exports [`opentalk-types-api-v1`](https://docs.rs/opentalk-types-api-v1) crate as [`api::v1`].
53* **signaling** -
54  Re-exports all content of the [`opentalk-types-signaling`](https://docs.rs/opentalk-types-signaling) crate in the [`signaling`] module.
55* **signaling-breakout** -
56  Re-exports [`opentalk-types-signaling-breakout`](https://docs.rs/opentalk-types-signaling-breakout) crate as [`signaling::breakout`].
57* **signaling-chat** -
58  Re-exports [`opentalk-types-signaling-chat`](https://docs.rs/opentalk-types-signaling-chat) crate as [`signaling::chat`].
59* **signaling-control** -
60  Re-exports [`opentalk-types-signaling-control`](https://docs.rs/opentalk-types-signaling-control) crate as [`signaling::control`].
61* **signaling-livekit** -
62  Re-exports [`opentalk-types-signaling-livekit`](https://docs.rs/opentalk-types-signaling-livekit) crate as [`signaling::livekit`].
63* **signaling-meeting-notes** -
64  Re-exports [`opentalk-types-signaling-meeting-notes`](https://docs.rs/opentalk-types-signaling-meeting-notes) crate as [`signaling::meeting-notes`].
65* **signaling-meeting-report** -
66  Re-exports [`opentalk-types-signaling-meeting-report`](https://docs.rs/opentalk-types-signaling-meeting-report) crate as [`signaling::meeting-report`].
67* **signaling-moderation** -
68  Re-exports [`opentalk-types-signaling-moderation`](https://docs.rs/opentalk-types-signaling-moderation) crate as [`signaling::moderation`].
69* **signaling-polls** -
70  Re-exports [`opentalk-types-signaling-polls`](https://docs.rs/opentalk-types-signaling-polls) crate as [`signaling::polls`].
71* **signaling-recording** -
72  Re-exports [`opentalk-types-signaling-recording`](https://docs.rs/opentalk-types-signaling-recording) crate as [`signaling::recording`].
73* **signaling-recording-service** -
74  Re-exports [`opentalk-types-signaling-recording-service`](https://docs.rs/opentalk-types-signaling-recording-service) crate as [`signaling::recording-service`].
75* **signaling-shared-folder** -
76  Re-exports [`opentalk-types-signaling-shared-folder`](https://docs.rs/opentalk-types-signaling-shared-folder) crate as [`signaling::shared-folder`].
77* **signaling-subroom-audio** -
78  Re-exports [`opentalk-types-signaling-subroom-audio`](https://docs.rs/opentalk-types-signaling-subroom-audio) crate as [`signaling::subroom-audio`].
79* **signaling-timer** -
80  Re-exports [`opentalk-types-signaling-timer`](https://docs.rs/opentalk-types-signaling-timer) crate as [`signaling::timer`].
81* **signaling-training-participation-report** -
82  Re-exports [`opentalk-types-signaling-training-participation-report`](https://docs.rs/opentalk-types-signaling-training-participation-report) crate as [`signaling::training_participation_report`].
83* **signaling-whiteboard** -
84  Re-exports [`opentalk-types-signaling-whiteboard`](https://docs.rs/opentalk-types-signaling-whiteboard) crate as [`signaling::whiteboard`].
85
86## Functionality features
87
88* **clap** -
89  Should be enabled when implementing command-line tooling that exposes the
90  types using [`clap`](https://docs.rs/clap). This allows listing the possible
91  values of enumeration types using the builtin `--help` functionality of `clap`.
92* **diesel** -
93  Enabling this feature makes some newtypes storable in a database through the
94  [`diesel`](https://docs.rs/diesel) crate. Used for implementing the server
95  side with a `diesel` database backend.
96* **kustos** -
97  Adds some metadata to types that represent API resources, so that the `kustos`
98  permission enforcement system can determine which permissions it needs to
99  apply to certain endpoints when implementing the server side of the API.
100* **rand** -
101  Adds random generation of some datatypes such as `uuid`, so that they can
102  be generated on the server side in the API endpoint implementation or inside
103  signaling modules.
104* **redis** -
105  Adds annotations to some signaling data types so that they can be stored
106  inside redis by the server side of a signaling module.
107* **serde** -
108  Adds [`serde`](https://docs.rs/serde/) `Serialize` and `Deserialize`
109  implementations for each datatype that is sent over the network.
110* **utoipa** -
111  Adds [`utoipa`](https://docs.rs/utoipa/) `ToSchema` and `IntoParams`
112  implementations to all types that are exposed in the OpenTalk Web API, so that
113  they can be used to generate an OpenAPI specification of the Web API.
114*/
115
116#![deny(
117    bad_style,
118    missing_debug_implementations,
119    missing_docs,
120    overflowing_literals,
121    patterns_in_fns_without_body,
122    trivial_casts,
123    trivial_numeric_casts,
124    unsafe_code,
125    unused,
126    unused_extern_crates,
127    unused_import_braces,
128    unused_qualifications,
129    unused_results
130)]
131
132#[cfg(feature = "common")]
133pub use opentalk_types_common as common;
134
135#[cfg(feature = "api-v1")]
136pub mod api {
137    /*!
138    Re-exports all known API versions under the corresponding name.
139    */
140    pub use opentalk_types_api_v1 as v1;
141}
142
143#[cfg(feature = "signaling")]
144pub mod signaling {
145    /*!
146    Re-exports all known signaling modules, each gated by a feature
147    called `signaling-<modulename>`, e.g. `signaling-control` or
148    `signaling-subroom-audio`.
149    */
150    pub use opentalk_types_signaling::*;
151    #[cfg(feature = "signaling-automod")]
152    pub use opentalk_types_signaling_automod as automod;
153    #[cfg(feature = "signaling-breakout")]
154    pub use opentalk_types_signaling_breakout as breakout;
155    #[cfg(feature = "signaling-chat")]
156    pub use opentalk_types_signaling_chat as chat;
157    #[cfg(feature = "signaling-control")]
158    pub use opentalk_types_signaling_control as control;
159    #[cfg(feature = "signaling-e2ee")]
160    pub use opentalk_types_signaling_e2ee as e2ee;
161    #[cfg(feature = "signaling-legal-vote")]
162    pub use opentalk_types_signaling_legal_vote as legal_vote;
163    #[cfg(feature = "signaling-livekit")]
164    pub use opentalk_types_signaling_livekit as livekit;
165    #[cfg(feature = "signaling-meeting-notes")]
166    pub use opentalk_types_signaling_meeting_notes as meeting_notes;
167    #[cfg(feature = "signaling-meeting-report")]
168    pub use opentalk_types_signaling_meeting_report as meeting_report;
169    #[cfg(feature = "signaling-moderation")]
170    pub use opentalk_types_signaling_moderation as moderation;
171    #[cfg(feature = "signaling-polls")]
172    pub use opentalk_types_signaling_polls as polls;
173    #[cfg(feature = "signaling-recording")]
174    pub use opentalk_types_signaling_recording as recording;
175    #[cfg(feature = "signaling-recording-service")]
176    pub use opentalk_types_signaling_recording_service as recording_service;
177    #[cfg(feature = "signaling-shared-folder")]
178    pub use opentalk_types_signaling_shared_folder as shared_folder;
179    #[cfg(feature = "signaling-subroom-audio")]
180    pub use opentalk_types_signaling_subroom_audio as subroom_audio;
181    #[cfg(feature = "signaling-timer")]
182    pub use opentalk_types_signaling_timer as timer;
183    #[cfg(feature = "signaling-training-participation-report")]
184    pub use opentalk_types_signaling_training_participation_report as training_participation_report;
185    #[cfg(feature = "signaling-whiteboard")]
186    pub use opentalk_types_signaling_whiteboard as whiteboard;
187}