pub enum ComponentValue {
String(String),
Integer(i64),
Float(f64),
Boolean(bool),
}Expand description
Enum defining the supported dataset in the World and how it maps with Rust data types
Variants§
Implementations§
Source§impl ComponentValue
impl ComponentValue
Sourcepub fn unwrap_string(self) -> String
pub fn unwrap_string(self) -> String
Unwraps Enum to its parameter value
Get String inside Enum parameter. Panics if the ComponentValue is not a String
Sourcepub fn unwrap_float(self) -> f64
pub fn unwrap_float(self) -> f64
Unwraps Enum to its parameter value
Get f64 inside Enum parameter. Panics if the ComponentValue is not an f64
Sourcepub fn unwrap_int(self) -> i64
pub fn unwrap_int(self) -> i64
Unwraps Enum to its parameter value
Get i64 inside Enum parameter. Panics if the ComponentValue is not an i64
Sourcepub fn unwrap_bool(self) -> bool
pub fn unwrap_bool(self) -> bool
Unwraps Enum to its parameter value
Get bool inside Enum parameter. Panics if the ComponentValue is not an bool
Trait Implementations§
Source§impl BorshDeserialize for ComponentValue
impl BorshDeserialize for ComponentValue
fn deserialize_reader<__R: Read>(reader: &mut __R) -> Result<Self, Error>
Source§fn deserialize(buf: &mut &[u8]) -> Result<Self, Error>
fn deserialize(buf: &mut &[u8]) -> Result<Self, Error>
Deserializes this instance from a given slice of bytes.
Updates the buffer to point at the remaining bytes.
Source§fn try_from_slice(v: &[u8]) -> Result<Self, Error>
fn try_from_slice(v: &[u8]) -> Result<Self, Error>
Deserialize this instance from a slice of bytes.
fn try_from_reader<R>(reader: &mut R) -> Result<Self, Error>where
R: Read,
Source§impl BorshSerialize for ComponentValue
impl BorshSerialize for ComponentValue
Source§impl Clone for ComponentValue
impl Clone for ComponentValue
Source§fn clone(&self) -> ComponentValue
fn clone(&self) -> ComponentValue
Returns a duplicate 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 ComponentValue
impl Debug for ComponentValue
Source§impl EnumExt for ComponentValue
impl EnumExt for ComponentValue
Source§impl PartialEq for ComponentValue
impl PartialEq for ComponentValue
impl Eq for ComponentValue
Auto Trait Implementations§
impl Freeze for ComponentValue
impl RefUnwindSafe for ComponentValue
impl Send for ComponentValue
impl Sync for ComponentValue
impl Unpin for ComponentValue
impl UnwindSafe for ComponentValue
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