pub struct WireU64(/* private fields */);Expand description
A logical u64 that travels as a canonical decimal string.
Canonical means: ASCII digits only, no sign, no radix prefix, no surrounding whitespace and
no leading zeros ("0" is the only representation of zero). Two hosts that mean the same
number therefore always produce the same bytes — a precondition for canonical record digests.
Implementations§
Source§impl WireU64
impl WireU64
pub const ZERO: Self
pub const fn new(value: u64) -> Self
pub const fn get(self) -> u64
Sourcepub const fn is_js_safe(self) -> bool
pub const fn is_js_safe(self) -> bool
Whether this value survives a round-trip through a JS number. Hosts that project to
bigint or keep the branded decimal string never need to ask.
pub fn parse(text: &str) -> Result<Self, WireScalarError>
Trait Implementations§
impl Copy for WireU64
Source§impl<'de> Deserialize<'de> for WireU64
impl<'de> Deserialize<'de> for WireU64
Source§fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
Deserialize this value from the given Serde deserializer. Read more
impl Eq for WireU64
Source§impl Ord for WireU64
impl Ord for WireU64
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
Source§impl PartialOrd for WireU64
impl PartialOrd for WireU64
impl StructuralPartialEq for WireU64
Auto Trait Implementations§
impl Freeze for WireU64
impl RefUnwindSafe for WireU64
impl Send for WireU64
impl Sync for WireU64
impl Unpin for WireU64
impl UnsafeUnpin for WireU64
impl UnwindSafe for WireU64
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> ToCompactString for Twhere
T: Display,
impl<T> ToCompactString for Twhere
T: Display,
Source§fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
Fallible version of
ToCompactString::to_compact_string() Read moreSource§fn to_compact_string(&self) -> CompactString
fn to_compact_string(&self) -> CompactString
Converts the given value to a
CompactString. Read more