Skip to main content

rskit_grpc/
lib.rs

1#![warn(missing_docs)]
2#![doc = include_str!("../README.md")]
3
4//! gRPC transport and status-mapping entrypoints for rskit.
5//!
6//! `rskit-grpc` always owns `tonic::Status` ↔ `rskit_errors::AppError`
7//! mapping so client and server crates share one canonical transport boundary.
8//! With the `client` feature enabled, it also owns lazy channels, TLS-aware
9//! dialing, and optional discovery integration.
10//!
11//! Lifecycle-managed gRPC servers are owned by `rskit-server`.
12
13#[cfg(feature = "client")]
14/// gRPC channel wrapper with lazy connection management.
15pub mod channel;
16#[cfg(feature = "client")]
17/// gRPC client configuration.
18pub mod config;
19/// Error mapping between tonic [`Status`](tonic::Status) and [`AppError`](rskit_errors::AppError).
20pub mod errors;
21
22#[cfg(all(feature = "client", feature = "discovery"))]
23/// Service discovery integration.
24pub mod discovery;
25
26#[cfg(feature = "client")]
27pub use channel::GrpcChannel;
28#[cfg(feature = "client")]
29pub use config::GrpcClientConfig;
30pub use errors::{
31    app_error_to_status, error_code_to_grpc_code, grpc_code_to_error_code, status_to_app_error,
32};
33#[cfg(feature = "client")]
34pub use rskit_security::TlsConfig as GrpcClientTlsConfig;
35
36#[cfg(all(feature = "client", feature = "discovery"))]
37pub use discovery::{DiscoveryChannel, DiscoveryChannelConfig};