silicon-heaven / libshvclient-rs

A Rust framework for Silicon Heaven RPC devices
MIT License
0 stars 3 forks source link

Convert param in `fixed_node` macro for any `T: TryFrom<&RpcValue>` #17

Closed j4r0u53k closed 2 months ago

j4r0u53k commented 2 months ago

If a parameter in a method definition is specified, the macro will automatically try to convert it to the specified type, for which TryFrom<&RpcValue> is implemented and generates an error response if the conversion fails.

Conversions for basic types are implemented in libshvproto since 3.0.1.

simple_device_tokio.rs example demonstrates usage for a custom type.

(#9)