mirror of
https://github.com/Start9Labs/rpc-toolkit.git
synced 2026-03-30 04:11:58 +00:00
clone, dont serialize
This commit is contained in:
@@ -1,7 +1,6 @@
|
|||||||
use std::any::TypeId;
|
use std::any::TypeId;
|
||||||
use std::collections::VecDeque;
|
use std::collections::VecDeque;
|
||||||
use std::ffi::OsString;
|
use std::ffi::OsString;
|
||||||
use std::time::Duration;
|
|
||||||
|
|
||||||
use clap::{CommandFactory, FromArgMatches};
|
use clap::{CommandFactory, FromArgMatches};
|
||||||
use imbl_value::Value;
|
use imbl_value::Value;
|
||||||
@@ -13,7 +12,7 @@ use tokio::io::{AsyncBufReadExt, AsyncRead, AsyncWrite, AsyncWriteExt, BufReader
|
|||||||
use url::Url;
|
use url::Url;
|
||||||
use yajrc::{Id, RpcError};
|
use yajrc::{Id, RpcError};
|
||||||
|
|
||||||
use crate::util::{internal_error, parse_error, Flat, PhantomData};
|
use crate::util::{internal_error, parse_error, PhantomData};
|
||||||
use crate::{
|
use crate::{
|
||||||
AnyHandler, CliBindingsAny, DynHandler, HandleAny, HandleAnyArgs, Handler, HandlerArgs,
|
AnyHandler, CliBindingsAny, DynHandler, HandleAny, HandleAnyArgs, Handler, HandlerArgs,
|
||||||
HandlerArgsFor, HandlerTypes, IntoContext, Name, ParentHandler, PrintCliResult,
|
HandlerArgsFor, HandlerTypes, IntoContext, Name, ParentHandler, PrintCliResult,
|
||||||
@@ -226,11 +225,7 @@ where
|
|||||||
.collect::<Vec<_>>();
|
.collect::<Vec<_>>();
|
||||||
match handle_args
|
match handle_args
|
||||||
.context
|
.context
|
||||||
.call_remote(
|
.call_remote(&full_method.join("."), handle_args.raw_params.clone())
|
||||||
&full_method.join("."),
|
|
||||||
imbl_value::to_value(&Flat(handle_args.params, handle_args.inherited_params))
|
|
||||||
.map_err(parse_error)?,
|
|
||||||
)
|
|
||||||
.await
|
.await
|
||||||
{
|
{
|
||||||
Ok(a) => imbl_value::from_value(a)
|
Ok(a) => imbl_value::from_value(a)
|
||||||
|
|||||||
@@ -500,10 +500,7 @@ where
|
|||||||
EitherContext::C1(context) => {
|
EitherContext::C1(context) => {
|
||||||
let full_method = parent_method.into_iter().chain(method).collect::<Vec<_>>();
|
let full_method = parent_method.into_iter().chain(method).collect::<Vec<_>>();
|
||||||
match context
|
match context
|
||||||
.call_remote(
|
.call_remote(&full_method.join("."), raw_params.clone())
|
||||||
&full_method.join("."),
|
|
||||||
imbl_value::to_value(&raw_params).map_err(parse_error)?,
|
|
||||||
)
|
|
||||||
.await
|
.await
|
||||||
{
|
{
|
||||||
Ok(a) => imbl_value::from_value(a)
|
Ok(a) => imbl_value::from_value(a)
|
||||||
|
|||||||
Reference in New Issue
Block a user