pub struct U64String(/* private fields */);Expand description
A u64 value that serializes as a string.
Some JSON parsers (particularly in JavaScript) cannot accurately represent
large integers. This type serializes u64 values as strings to preserve
precision across all platforms.
§Example
use x402_types::proto::util::U64String;
let value = U64String::from(12345678901234567890u64);
let json = serde_json::to_string(&value).unwrap();
assert_eq!(json, "\"12345678901234567890\"");Implementations§
Trait Implementations§
Source§impl<'de> Deserialize<'de> for U64String
impl<'de> Deserialize<'de> for U64String
Source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for U64String
impl StructuralPartialEq for U64String
Auto Trait Implementations§
impl Freeze for U64String
impl RefUnwindSafe for U64String
impl Send for U64String
impl Sync for U64String
impl Unpin for U64String
impl UnwindSafe for U64String
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more