capnproto / capnp-rpc-rust

Cap'n Proto RPC for Rust
125 stars 16 forks source link

Using Rust datatypes via RPC #10

Open anfractuosity opened 9 years ago

anfractuosity commented 9 years ago

Hi,

I'm just wondering if you could point me in the right direction, on how to use non-standard datatypes, such as those which are specific to Rust, such as bigints, via RPC.

Would I need to represent the data as say an array of bytes, then use Rusts transmute feature to convert to a bigint somehow, or is there a better way?

cheers

Chris

dwrensha commented 9 years ago

Using the Cap'n Proto Data type sounds sensible to me. However, I would shy away from using transmute(). It looks like BigInt has functions like from_bytes_le() that would be better suited for that purpose.