Skip to main content

hyperlane_plugin_rpc/
lib.rs

1//! hyperlane-plugin-rpc
2//!
3//! High-concurrency JSON-RPC 2.0 server plugin for Hyperlane with `XxHash3_64`
4//! async method routing, concurrent batch dispatch, extensible interceptors,
5//! notification handling, and an opt-in [`ServerHook`].
6
7mod r#const;
8mod r#enum;
9mod r#fn;
10mod r#impl;
11mod r#static;
12mod r#struct;
13mod r#trait;
14mod r#type;
15
16#[cfg(test)]
17#[path = "../tests/mod.rs"]
18mod tests;
19
20pub use {r#const::*, r#enum::*, r#struct::*, r#trait::*, r#type::*};
21
22pub(crate) use {
23    r#fn::*,
24    r#static::*,
25    r#type::{PreparedBorrowedCall, PreparedRpcCall, RpcMethodMap},
26};
27
28use std::{
29    borrow::Cow,
30    collections::HashMap,
31    error::Error,
32    fmt::{self, Display, Formatter},
33    future::{Future, poll_fn},
34    hash::{BuildHasherDefault, Hasher},
35    pin::Pin,
36    sync::{Arc, OnceLock},
37    task::{self, Poll},
38};
39
40use {
41    hyperlane::{
42        APPLICATION_JSON, CONTENT_TYPE, Context, HttpStatus, OK, Response, ResponseError,
43        ServerHook, Status, Stream,
44    },
45    lombok_macros::*,
46    serde::{
47        Deserialize, Deserializer, Serialize,
48        de::{self, IgnoredAny, MapAccess, SeqAccess, Visitor},
49    },
50    serde_json::{self, Value, from_slice, from_value, to_writer},
51};