pub struct MoveU256(pub [u8; 32]);Expand description
A u256 value for Move arguments.
Move’s u256 is a 256-bit unsigned integer, represented as 32 bytes in little-endian.
Tuple Fields§
§0: [u8; 32]Implementations§
Source§impl MoveU256
impl MoveU256
Sourcepub fn parse(s: &str) -> AptosResult<Self>
pub fn parse(s: &str) -> AptosResult<Self>
Creates a MoveU256 from a decimal string.
Supports the full unsigned 256-bit range (0..=2^256 - 1), matching how
the Aptos JSON API encodes u256 values (as a decimal string).
§Errors
Returns an error if s is empty, contains a non-digit character, or
represents a value that does not fit in 256 bits.
Sourcepub fn from_le_bytes(bytes: [u8; 32]) -> Self
pub fn from_le_bytes(bytes: [u8; 32]) -> Self
Creates a MoveU256 from raw bytes (little-endian).
Sourcepub fn to_decimal_string(&self) -> String
pub fn to_decimal_string(&self) -> String
Returns the value as a decimal string (matching the Aptos JSON encoding).
Trait Implementations§
impl Copy for MoveU256
Source§impl<'de> Deserialize<'de> for MoveU256
impl<'de> Deserialize<'de> for MoveU256
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 MoveU256
impl StructuralPartialEq for MoveU256
Auto Trait Implementations§
impl Freeze for MoveU256
impl RefUnwindSafe for MoveU256
impl Send for MoveU256
impl Sync for MoveU256
impl Unpin for MoveU256
impl UnsafeUnpin for MoveU256
impl UnwindSafe for MoveU256
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>,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoMoveArg for Twhere
T: Serialize,
impl<T> IntoMoveArg for Twhere
T: Serialize,
Source§fn into_move_arg(self) -> Result<Vec<u8>, AptosError>
fn into_move_arg(self) -> Result<Vec<u8>, AptosError>
Converts this value into BCS-encoded bytes. Read more
§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.