pub enum StellarValue {
Show 20 variants
Bool(bool),
Void,
U32(u32),
I32(i32),
U64(u64),
I64(i64),
U128(String),
I128(String),
U256(String),
I256(String),
Bytes(Vec<u8>),
String(String),
Symbol(String),
Vec(Vec<StellarValue>),
Map(BTreeMap<String, StellarValue>),
Tuple(Vec<StellarValue>),
Address(String),
Timepoint(u64),
Duration(u64),
Udt(String),
}
Expand description
Represents all possible Stellar smart contract values
Variants§
Bool(bool)
Boolean value
Void
Void value (null/empty)
U32(u32)
32-bit unsigned integer value
I32(i32)
32-bit signed integer value
U64(u64)
64-bit unsigned integer value
I64(i64)
64-bit signed integer value
U128(String)
128-bit unsigned integer value (as string)
I128(String)
128-bit signed integer value (as string)
U256(String)
256-bit unsigned integer value (as string)
I256(String)
256-bit signed integer value (as string)
Bytes(Vec<u8>)
Byte array value
String(String)
String value
Symbol(String)
Symbol value
Vec(Vec<StellarValue>)
Vector of values
Map(BTreeMap<String, StellarValue>)
Map of key-value pairs
Tuple(Vec<StellarValue>)
Tuple of values
Address(String)
Stellar address value
Timepoint(u64)
Timepoint value
Duration(u64)
Duration value
Udt(String)
User-defined type value
Implementations§
Source§impl StellarValue
impl StellarValue
Sourcepub fn get_type(&self) -> StellarType
pub fn get_type(&self) -> StellarType
Sourcepub fn to_json(&self) -> Value
pub fn to_json(&self) -> Value
Converts this Stellar value to a JSON value.
§Returns
A serde_json::Value representing this Stellar value
Sourcepub fn to_param_entry(&self, indexed: bool) -> StellarDecodedParamEntry
pub fn to_param_entry(&self, indexed: bool) -> StellarDecodedParamEntry
Trait Implementations§
Source§impl Clone for StellarValue
impl Clone for StellarValue
Source§fn clone(&self) -> StellarValue
fn clone(&self) -> StellarValue
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for StellarValue
impl Debug for StellarValue
Source§impl Display for StellarValue
impl Display for StellarValue
Auto Trait Implementations§
impl Freeze for StellarValue
impl RefUnwindSafe for StellarValue
impl Send for StellarValue
impl Sync for StellarValue
impl Unpin for StellarValue
impl UnwindSafe for StellarValue
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
§impl<T> Chain<T> for T
impl<T> Chain<T> for T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§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> 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