Skip to main content

rvoip_core_traits/
lib.rs

1//! # rvoip-core-traits
2//!
3//! Pure-data trait + type surface for the `rvoip` ecosystem.
4//!
5//! Carved out from `rvoip-core` (per GAP_PLAN.md V2.A) to break the
6//! `rvoip-core → rvoip-vcon → rvoip-auth-core → rvoip-core` dep
7//! cycle. Consumer crates (`rvoip-auth-core`, `rvoip-vcon`,
8//! `rvoip-harness`, `rvoip-identity`, and every adapter) depend on
9//! this crate for the types they need; `rvoip-core` itself
10//! re-exports from here so call sites like `use rvoip_core::ids::ConnectionId`
11//! keep working.
12//!
13//! ## Layering rule
14//!
15//! This crate has zero `rvoip-*` dependencies — that's what breaks
16//! the cycle. It depends only on `bytes`, `chrono`, `serde`,
17//! `serde_json`, and `uuid`.
18//!
19//! ## What lives here
20//!
21//! - [`ids`] — every `*Id` newtype (`ConnectionId`, `SessionId`,
22//!   `ConversationId`, `ParticipantId`, `IdentityId`, etc.).
23//! - [`adapter`] — pure adapter-facing request/event/reason structs
24//!   (`AdapterEvent`, `OriginateRequest`, `EndReason`, etc.).
25//! - [`identity`] — the pure-data identity types `IdentityAssurance`,
26//!   `Jwk`, `CredentialKind`, `Credential`, `IdentityKind`,
27//!   `DeviceKind`. The `IdentityProvider` trait + the structs that
28//!   reference rvoip-core's `Result` type (Identity, Device,
29//!   ReachabilityHint) stay in `rvoip-core::identity` because they
30//!   need the orchestrator's error type.
31//!
32//! ## Future scope
33//!
34//! Subsequent V2.A.* phases can move more modules here (events,
35//! commands, full identity trait, vcon types, signing, store traits,
36//! and eventually the full `ConnectionAdapter` trait once message and
37//! command types have moved) as the workspace's appetite for the
38//! move-cost tradeoff grows.
39
40pub mod adapter;
41pub mod broadcast;
42pub mod capability;
43pub mod connection;
44pub mod data;
45pub mod error;
46pub mod harness;
47pub mod identity;
48pub mod ids;
49pub mod stream;
50
51pub use adapter::{
52    ExternalConnectionReference, ExternalConnectionReferenceError, InboundConnectionContext,
53    InboundContextError, InboundRoutingHint, InboundSignalingMetadata, OriginateContext,
54    OutboundActivation, TransferStatus, MAX_EXTERNAL_CONNECTION_REFERENCES,
55    MAX_EXTERNAL_REFERENCE_KIND_BYTES, MAX_EXTERNAL_REFERENCE_VALUE_BYTES,
56    MAX_INBOUND_METADATA_BYTES, MAX_INBOUND_METADATA_FIELDS, MAX_INBOUND_METADATA_NAME_BYTES,
57    MAX_INBOUND_METADATA_VALUE_BYTES, MAX_INBOUND_ROUTING_HINT_BYTES,
58};
59pub use broadcast::{
60    BroadcastDescriptor, BroadcastDrainDescriptor, BroadcastDrainReason, BroadcastDrainRequest,
61    BroadcastDrainState, BroadcastEndpoint, BroadcastHealthDescriptor, BroadcastHealthIssue,
62    BroadcastHealthStatus, BroadcastLifecycleDescriptor, BroadcastLifecycleState,
63    BroadcastProtocolDescriptor, BroadcastProtocolFamily, BroadcastPublisher, BroadcastRelayHop,
64    BroadcastRelayRole, BroadcastResource, BroadcastSanitizedEvent,
65    BroadcastSanitizedEventCapability, BroadcastSanitizedEventError, BroadcastSanitizedEventKind,
66    BroadcastSubstrate, BroadcastTransport, MAX_BROADCAST_EVENT_JSON_INTEGER,
67};
68pub use data::{
69    DataMessage, DataMessageValidationError, DataReliability, MAX_CONTENT_TYPE_BYTES,
70    MAX_DATA_LABEL_BYTES, MAX_DATA_MESSAGE_BYTES, MAX_DATA_MESSAGE_ID_BYTES,
71};
72pub use identity::{
73    AuthenticatedPrincipal, AuthenticationMethod, BearerAuthError, PrincipalOwnershipKey,
74};
75pub use ids::TransferAttemptId;