Currently, the invoke method takes in invocation arguments as separate function arguments. Making typical invocations look like:
client.invoke(uri, method, args, None, None)
One consideration brought up by @nerfZael is to make invocation arguments a struct, ideally something similar to:
struct InvokeArgs<T: Serialize> {
uri: Uri,
method: String,
args: Option<T>,
env: Option<&[u8]>,
resolution_context: Option<&[u8]>
}
This would enable 2 main things:
client.invoke<R>(InvokeArgs {
uri: "test/hello",
method: "sayHello",
args: Some(MyArgs {...})
...Default::default()
}
- Passing method args as a serializable struct and encode it for the user; instead of forcing the user to encode them outside and pass them as an array of u8
The case for methods with no arguments would need to be handled
Currently, the
invokemethod takes in invocation arguments as separate function arguments. Making typical invocations look like:client.invoke(uri, method, args, None, None)One consideration brought up by @nerfZael is to make invocation arguments a struct, ideally something similar to:
This would enable 2 main things:
The case for methods with no arguments would need to be handled