pub struct SafeInt(/* private fields */);Expand description
A safe integer in the range 0 to 2^53-1.
Ensures integer values are compatible with JavaScript’s Number type and all common runtime environments.
Implementations§
Source§impl SafeInt
impl SafeInt
Sourcepub fn new_for_field(
value: u64,
field: impl Into<String>,
) -> Result<Self, AadError>
pub fn new_for_field( value: u64, field: impl Into<String>, ) -> Result<Self, AadError>
Validates value against the 2^53-1 bound.
§Errors
Returns IntegerOutOfRange if value exceeds MAX_SAFE_INTEGER.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for SafeInt
impl<'de> Deserialize<'de> for SafeInt
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
Source§impl Ord for SafeInt
impl Ord for SafeInt
Source§impl PartialOrd for SafeInt
impl PartialOrd for SafeInt
impl Copy for SafeInt
impl Eq for SafeInt
impl StructuralPartialEq for SafeInt
Auto Trait Implementations§
impl Freeze for SafeInt
impl RefUnwindSafe for SafeInt
impl Send for SafeInt
impl Sync for SafeInt
impl Unpin for SafeInt
impl UnsafeUnpin for SafeInt
impl UnwindSafe for SafeInt
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