roam/lib.rs
1//! Roam — Rust-native RPC where traits are the schema.
2//!
3//! This is the facade crate. It re-exports everything needed by both
4//! hand-written code and `#[roam::service]` macro-generated code.
5
6// Re-export the proc macro
7pub use roam_service_macros::service;
8
9// Re-export facet (generated code uses `roam::facet::Facet`)
10pub use facet;
11
12// Re-export facet-postcard (generated code uses `roam::facet_postcard::from_slice_borrowed`)
13pub use facet_postcard;
14
15// Re-export roam-hash (generated code uses `roam::hash::method_descriptor`)
16pub use roam_hash as hash;
17
18// Re-export roam-types items used by generated code
19pub use roam_types::{
20 Backing,
21 // Traits
22 Call,
23 Caller,
24 // Descriptors
25 ChannelId,
26 Conduit,
27 ConduitAcceptor,
28 ConduitRx,
29 ConduitTx,
30 ConduitTxPermit,
31 // Types
32 ConnectionId,
33 ConnectionSettings,
34 ErasedCaller,
35 Handler,
36 Link,
37 LinkRx,
38 LinkTx,
39 LinkTxPermit,
40 MessageFamily,
41 Metadata,
42 MetadataEntry,
43 MetadataFlags,
44 MetadataValue,
45 MethodDescriptor,
46 MethodId,
47 MsgFamily,
48 Parity,
49 Payload,
50 ReplySink,
51 RequestCall,
52 RequestResponse,
53 ResponseParts,
54 RoamError,
55 RpcPlan,
56 Rx,
57 RxError,
58 SelfRef,
59 ServiceDescriptor,
60 SinkCall,
61 // Channels
62 Tx,
63 TxError,
64 WriteSlot,
65 // Channels
66 channel,
67};
68
69// Re-export runtime/session primitives from `roam-core`.
70// This keeps user-facing setup to `roam` + a transport crate.
71#[cfg(feature = "runtime")]
72pub use roam_core::*;
73
74// Channel binding is only available on non-wasm32 targets
75#[cfg(not(target_arch = "wasm32"))]
76pub use roam_types::{bind_channels_callee_args, bind_channels_caller_args};
77
78// Re-export the session module (generated code uses `roam::session::ServiceDescriptor`)
79pub mod session {
80 pub use roam_types::{MethodDescriptor, ServiceDescriptor};
81}