Skip to content

Commit

Permalink
Implement TryFrom on RpcValue
Browse files Browse the repository at this point in the history
Implements TryFrom<&RpcValue> and TryFrom<RpcValue> for various
basic types and their references.

TryFrom<&RpcValue> would be useful e.g. for RPC requests params
parsing, where `RpcMessge::param()` returns `Option<&RpcValue>`.

TryFrom<RpcValue> can provide more efficient implementation for
larger datatypes (Blob, List, Map, String), where the returned
value is just moved out of the underlying Box without cloning.

Crates using this library can further add any implementations of
TryFrom<RpcValue> for their own types and  get a uniform way to
do all types conversions from RpcValue.
  • Loading branch information
j4r0u53k committed Jul 3, 2024
1 parent 9913791 commit 8195050
Showing 1 changed file with 405 additions and 2 deletions.
Loading

0 comments on commit 8195050

Please sign in to comment.