pub struct I64 {
pub negative: bool,
pub magnitude: u64,
}
Expand description
As Move does not support negative numbers natively, we use our own internal representation.
To consume these values, first call get_is_negative()
to determine if the I64
represents a negative or positive value. Then call get_magnitude_if_positive()
or
get_magnitude_if_negative()
to get the magnitude of the number in unsigned u64 format.
This API forces consumers to handle positive and negative numbers safely.
Fields§
§negative: bool
§magnitude: u64
Implementations§
Source§impl I64
impl I64
pub fn move_instance(self, address: Address) -> MoveInstance<Self>
pub fn type_(address: Address) -> I64TypeTag
Trait Implementations§
Source§impl<'de> Deserialize<'de> for I64
impl<'de> Deserialize<'de> for I64
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 MoveStruct for I64
impl MoveStruct for I64
type StructTag = I64TypeTag
Source§impl MoveType for I64
impl MoveType for I64
Source§impl StaticModule for I64
impl StaticModule for I64
fn module() -> Identifier
Source§impl StaticName for I64
impl StaticName for I64
fn name() -> Identifier
Source§impl StaticTypeParams for I64
impl StaticTypeParams for I64
fn type_params() -> Vec<TypeTag>
impl Eq for I64
impl StructuralPartialEq for I64
Auto Trait Implementations§
impl Freeze for I64
impl RefUnwindSafe for I64
impl Send for I64
impl Sync for I64
impl Unpin for I64
impl UnwindSafe for I64
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more