pub struct Registry { /* private fields */ }Expand description
Collects all documented RPC methods.
Implementations§
Source§impl Registry
impl Registry
Sourcepub fn generate_openrpc_doc(&self) -> Value
pub fn generate_openrpc_doc(&self) -> Value
Convert all registered methods into an OpenRPC JSON document.
pub fn generate_openrpc_doc_with_info(&self, info: &OpenRpcInfo) -> Value
Source§impl Registry
impl Registry
Sourcepub fn into_methods(self) -> Vec<MethodDoc>
pub fn into_methods(self) -> Vec<MethodDoc>
Consume the registry and yield the collected methods.
Sourcepub fn register_method<M: RpcMethod>(&mut self)
pub fn register_method<M: RpcMethod>(&mut self)
Convenience wrapper for registering a RpcMethod implementation.
Sourcepub fn extend<I>(&mut self, docs: I)where
I: IntoIterator<Item = MethodDoc>,
pub fn extend<I>(&mut self, docs: I)where
I: IntoIterator<Item = MethodDoc>,
Extend the registry with multiple method docs.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Registry
impl RefUnwindSafe for Registry
impl Send for Registry
impl Sync for Registry
impl Unpin for Registry
impl UnsafeUnpin for Registry
impl UnwindSafe for Registry
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more