pub struct UInt { /* private fields */ }Expand description
Represents an unsigned integer of any size.
Implementations§
Source§impl UInt
impl UInt
pub const ZERO: UInt
Sourcepub fn as_usize(&self) -> Option<usize>
pub fn as_usize(&self) -> Option<usize>
Attempts to convert this UInt to a usize. If the value is too large to fit,
returns None.
Sourcepub fn as_u64(&self) -> Option<u64>
pub fn as_u64(&self) -> Option<u64>
Attempts to convert this UInt to a u64. If the value is too large to fit,
returns None.
Sourcepub fn as_u128(&self) -> Option<u128>
pub fn as_u128(&self) -> Option<u128>
Attempts to convert this UInt to a u128. If the value is too large to fit,
returns None.
Sourcepub fn expect_usize(&self) -> IonResult<usize>
pub fn expect_usize(&self) -> IonResult<usize>
Attempts to convert this UInt to a usize. If the value is too large to fit,
returns an IonError.
Sourcepub fn expect_u64(&self) -> IonResult<u64>
pub fn expect_u64(&self) -> IonResult<u64>
Attempts to convert this UInt to a u64. If the value is too large to fit,
returns an IonError.
Sourcepub fn expect_u128(&self) -> IonResult<u128>
pub fn expect_u128(&self) -> IonResult<u128>
Attempts to convert this UInt to a u128. If the value is too large to fit,
returns an IonError.
Sourcepub fn number_of_decimal_digits(&self) -> u32
pub fn number_of_decimal_digits(&self) -> u32
Returns the number of digits in the base-10 representation of the UInteger.
pub fn from_le_bytes(bytes: &[u8]) -> UInt
pub fn to_le_bytes(&self) -> Vec<u8> ⓘ
Trait Implementations§
impl Eq for UInt
Source§impl From<UInt> for Coefficient
impl From<UInt> for Coefficient
Source§fn from(value: UInt) -> Coefficient
fn from(value: UInt) -> Coefficient
Converts to this type from the input type.
Source§impl Ord for UInt
impl Ord for UInt
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
Source§impl PartialOrd for UInt
impl PartialOrd for UInt
impl StructuralPartialEq for UInt
Source§impl TryFrom<&Coefficient> for UInt
impl TryFrom<&Coefficient> for UInt
Source§impl TryFrom<Coefficient> for UInt
impl TryFrom<Coefficient> for UInt
Auto Trait Implementations§
impl Freeze for UInt
impl RefUnwindSafe for UInt
impl Send for UInt
impl Sync for UInt
impl Unpin for UInt
impl UnsafeUnpin for UInt
impl UnwindSafe for UInt
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,
Source§impl<V> IntoAnnotatedElement for V
impl<V> IntoAnnotatedElement for V
Source§fn with_annotations<I: IntoAnnotations>(self, annotations: I) -> Element
fn with_annotations<I: IntoAnnotations>(self, annotations: I) -> Element
Converts the value into an Element with the specified annotations.
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