wamp_async
wamp_async copied to clipboard
Consider having high-level interfaces
I think, we should be able to use RawValue
instead of a parsed Value
(see #2), and thus avoid unnecessary deserialization (see https://github.com/pandaman64/serde-query/). I would also like to have a more high-level interface to kwargs, so instead of:
async fn echo(args: Option<WampArgs>, kwargs: Option<WampKwArgs>) -> Result<(Option<WampArgs>, Option<WampKwArgs>), WampError> {
}
I would prefer to have an option to write:
async fn echo(input: MyDeserializableInputType) -> Result<MySerializableOutputType, WampError> {
}
And from the caller side instead of:
let (Some(positional_args), Some(keyword_args)) = client.call("peer.echo", args, kwargs).await?;
use:
let result = client.call("peer.echo", my_serializable_struct).await?;