pub trait TimestampConversion {
// Required method
fn to_i64(self) -> Result<Option<i64>>;
}Expand description
Extension trait for Option
This trait provides convenient methods for converting Option
§Example
use ccxt_core::time::TimestampConversion;
let old_timestamp: Option<u64> = Some(1704110400000);
let new_timestamp = old_timestamp.to_i64().unwrap();
assert_eq!(new_timestamp, Some(1704110400000i64));
let none_timestamp: Option<u64> = None;
let converted = none_timestamp.to_i64().unwrap();
assert_eq!(converted, None);