dynamic_call
This crate allows looking up a trait method by name at runtime,
and calling the method with json arguments deserialized using serde_json.
Example
use dynamic_call;
The above code generates a module that looks like:
Supported methods
Methods with type parameters are not supported.
Static methods as well as methods with self, &self, or &mut self are all supported.
A compatible version of call_dynamic_X must be called depending on the method's self type.
Arguments are deserialized using serde_json. The arguments value must be an array or
an object where the keys match the method's parameter names. Extra arguments in the
array or object are ignored.
Parameter types are supported if they implement Clone and DeserializeOwned.
Additionally, string, array, and path slices are supported.
More specifically, an argument may be of the form T, &T, or &mut T, where
T: ToOwned and T::Owned: DeserializeOwned.
To skip a method, use the #[dynamic_call::skip] attribute.
License: MIT OR Apache-2.0