I'm using toml to parse data, and I have this struct:
use serde_derive::Deserialize;
use toml::value::Datetime;
#[derive(Debug, Deserialize)]
pub struct Trade {
pub action: Action,
pub date_time: Datetime,
pub exchange: Exchange,
pub fee: i64,
pub id: Option<String>,
pub matched: Option<bool>,
pub price: i64,
pub quantity: i64,
}
I'd like to replace the integers (i64
) with BigInt
, a struct from the num library.
Is this possible? Do I have to implement the Deserialize
trait myself?