Skip to main content

vgi_rpc/
lib.rs

1//! vgi-rpc — transport-agnostic RPC framework built on Apache Arrow IPC.
2//!
3//! This crate provides a server-side implementation compatible with the
4//! Python `vgi_rpc` canonical wire protocol. Clients (pipe/subprocess/unix/http)
5//! supplied by other languages can drive a [`RpcServer`] transparently.
6
7pub mod access_log;
8pub mod arrow_type;
9pub mod auth;
10#[cfg(feature = "crypto")]
11pub mod crypto;
12pub mod errors;
13pub mod retry;
14
15#[cfg(feature = "external")]
16pub mod external;
17
18#[cfg(feature = "otel")]
19pub mod otel;
20
21pub mod hooks;
22/// Wire-framing helpers for proxies, routers, and gateways. Unfeatured, so an
23/// intermediary needn't pull the server or HTTP stack.
24pub mod intermediary;
25pub mod introspect;
26pub mod log;
27pub mod metadata;
28#[cfg(feature = "sentry-sdk")]
29pub mod sentry_sdk;
30#[cfg(feature = "sentry-tracing")]
31pub mod sentry_tracing;
32pub mod server;
33#[cfg(feature = "shm")]
34pub mod shm;
35pub mod stream;
36// stream_codec is pure serde+bincode (no axum/tokio/crypto) and is used by the
37// core dispatch path, so it's available without the full `http` stack — keeping
38// the crate wasm-buildable. `http` still pulls it in transitively.
39#[cfg(feature = "stream-codec")]
40pub mod stream_codec;
41pub mod tcp;
42pub mod transport;
43pub mod transport_options;
44pub mod unauthorized;
45#[cfg(unix)]
46pub mod unix;
47pub(crate) mod util;
48pub mod wire;
49
50#[cfg(feature = "http")]
51pub mod http;
52#[cfg(feature = "http")]
53pub mod sticky;
54
55pub use access_log::AccessLogHook;
56pub use arrow_type::{
57    Bytes, Decimal20_4, DictString, FixedBinary, LargeBytes, LargeBytesBuffer, LargeString,
58    UtcTimestamp, VgiArrow,
59};
60
61pub use auth::oauth::OAuthResourceMetadata;
62pub use auth::{chain_all, chain_authenticate, AuthContext, AuthRequest, AuthResult, Authenticate};
63pub use errors::{Result, RpcError};
64#[cfg(feature = "external")]
65pub use external::{
66    upload_url_params_schema, upload_url_response_schema, MAX_UPLOAD_URL_COUNT, UPLOAD_URL_METHOD,
67};
68pub use hooks::{
69    AccessSink, CallStatistics, ChainHook, DeferredRecord, DispatchHook, DispatchInfo, HookToken,
70    SharedHook,
71};
72pub use intermediary::{
73    build_error_stream, find_protocol_version, find_state_token, read_request, read_unary_result,
74    write_request, write_unary_result,
75};
76pub use introspect::{DESCRIBE_METHOD_NAME, DESCRIBE_VERSION};
77pub use log::{LogLevel, LogMessage};
78pub use retry::RetryConfig;
79pub use server::{
80    CallContext, MethodInfo, MethodType, Request, RpcServer, RpcServerBuilder, StickySink,
81};
82#[cfg(feature = "http")]
83pub use sticky::{DrainHandle, SessionRegistry};
84pub use stream::{ExchangeState, OutputCollector, ProducerState, StreamResult};
85pub use transport::{ServeStartHook, TransportCapabilities, TransportKind};
86
87#[cfg(feature = "otel")]
88pub use otel::{OtelConfig, OtelHook, OtelMetrics};
89#[cfg(feature = "sentry-sdk")]
90pub use sentry_sdk::{SentrySdkConfig, SentrySdkHook};
91#[cfg(feature = "sentry-tracing")]
92pub use sentry_tracing::{TracingSentryConfig, TracingSentryHook};
93
94#[cfg(feature = "macros")]
95pub use vgi_rpc_macros::{exchange, param, producer, service, unary, StreamState, VgiArrow};