mirror of
https://github.com/Start9Labs/rpc-toolkit.git
synced 2026-03-26 02:11:56 +00:00
add metadata to call_remote
This commit is contained in:
@@ -78,6 +78,7 @@ pub trait CallRemote<RemoteContext, Extra = Empty>: crate::Context {
|
|||||||
fn call_remote(
|
fn call_remote(
|
||||||
&self,
|
&self,
|
||||||
method: &str,
|
method: &str,
|
||||||
|
metadata: OrdMap<&'static str, Value>,
|
||||||
params: Value,
|
params: Value,
|
||||||
extra: Extra,
|
extra: Extra,
|
||||||
) -> impl Future<Output = Result<Value, RpcError>> + Send;
|
) -> impl Future<Output = Result<Value, RpcError>> + Send;
|
||||||
@@ -239,12 +240,13 @@ where
|
|||||||
let full_method = handle_args
|
let full_method = handle_args
|
||||||
.parent_method
|
.parent_method
|
||||||
.into_iter()
|
.into_iter()
|
||||||
.chain(handle_args.method)
|
.chain(handle_args.method.clone())
|
||||||
.collect::<Vec<_>>();
|
.collect::<Vec<_>>();
|
||||||
match handle_args
|
match handle_args
|
||||||
.context
|
.context
|
||||||
.call_remote(
|
.call_remote(
|
||||||
&full_method.join("."),
|
&full_method.join("."),
|
||||||
|
self.handler.metadata(handle_args.method),
|
||||||
without(handle_args.raw_params.clone(), &handle_args.params.1)
|
without(handle_args.raw_params.clone(), &handle_args.params.1)
|
||||||
.map_err(invalid_params)?,
|
.map_err(invalid_params)?,
|
||||||
handle_args.params.1,
|
handle_args.params.1,
|
||||||
|
|||||||
Reference in New Issue
Block a user