pub enum Primitive {
Show 16 variants
I8(Option<i8>),
I16(Option<i16>),
I32(Option<i32>),
I64(Option<i64>),
I128(Option<i128>),
U8(Option<u8>),
U16(Option<u16>),
U32(Option<u32>),
U64(Option<u64>),
U128(Option<u128>),
U256(Option<U256>),
Bool(Option<bool>),
Felt252(Option<Felt>),
ClassHash(Option<Felt>),
ContractAddress(Option<Felt>),
EthAddress(Option<Felt>),
}Variants§
I8(Option<i8>)
I16(Option<i16>)
I32(Option<i32>)
I64(Option<i64>)
I128(Option<i128>)
U8(Option<u8>)
U16(Option<u16>)
U32(Option<u32>)
U64(Option<u64>)
U128(Option<u128>)
U256(Option<U256>)
Bool(Option<bool>)
Felt252(Option<Felt>)
ClassHash(Option<Felt>)
ContractAddress(Option<Felt>)
EthAddress(Option<Felt>)
Implementations§
Source§impl Primitive
impl Primitive
Sourcepub fn as_i8(&self) -> Option<i8>
pub fn as_i8(&self) -> Option<i8>
If the Primitive is variant type, returns the associated vartiant value. Returns
None otherwise.
Sourcepub fn as_i16(&self) -> Option<i16>
pub fn as_i16(&self) -> Option<i16>
If the Primitive is variant type, returns the associated vartiant value. Returns
None otherwise.
Sourcepub fn as_i32(&self) -> Option<i32>
pub fn as_i32(&self) -> Option<i32>
If the Primitive is variant type, returns the associated vartiant value. Returns
None otherwise.
Sourcepub fn as_i64(&self) -> Option<i64>
pub fn as_i64(&self) -> Option<i64>
If the Primitive is variant type, returns the associated vartiant value. Returns
None otherwise.
Sourcepub fn as_i128(&self) -> Option<i128>
pub fn as_i128(&self) -> Option<i128>
If the Primitive is variant type, returns the associated vartiant value. Returns
None otherwise.
Sourcepub fn as_u8(&self) -> Option<u8>
pub fn as_u8(&self) -> Option<u8>
If the Primitive is variant type, returns the associated vartiant value. Returns
None otherwise.
Sourcepub fn as_u16(&self) -> Option<u16>
pub fn as_u16(&self) -> Option<u16>
If the Primitive is variant type, returns the associated vartiant value. Returns
None otherwise.
Sourcepub fn as_u32(&self) -> Option<u32>
pub fn as_u32(&self) -> Option<u32>
If the Primitive is variant type, returns the associated vartiant value. Returns
None otherwise.
Sourcepub fn as_u64(&self) -> Option<u64>
pub fn as_u64(&self) -> Option<u64>
If the Primitive is variant type, returns the associated vartiant value. Returns
None otherwise.
Sourcepub fn as_u128(&self) -> Option<u128>
pub fn as_u128(&self) -> Option<u128>
If the Primitive is variant type, returns the associated vartiant value. Returns
None otherwise.
Sourcepub fn as_u256(&self) -> Option<U256>
pub fn as_u256(&self) -> Option<U256>
If the Primitive is variant type, returns the associated vartiant value. Returns
None otherwise.
Sourcepub fn as_bool(&self) -> Option<bool>
pub fn as_bool(&self) -> Option<bool>
If the Primitive is variant type, returns the associated vartiant value. Returns
None otherwise.
Sourcepub fn as_felt252(&self) -> Option<Felt>
pub fn as_felt252(&self) -> Option<Felt>
If the Primitive is variant type, returns the associated vartiant value. Returns
None otherwise.
Sourcepub fn as_class_hash(&self) -> Option<Felt>
pub fn as_class_hash(&self) -> Option<Felt>
If the Primitive is variant type, returns the associated vartiant value. Returns
None otherwise.
Sourcepub fn as_contract_address(&self) -> Option<Felt>
pub fn as_contract_address(&self) -> Option<Felt>
If the Primitive is variant type, returns the associated vartiant value. Returns
None otherwise.
Sourcepub fn as_eth_address(&self) -> Option<Felt>
pub fn as_eth_address(&self) -> Option<Felt>
If the Primitive is variant type, returns the associated vartiant value. Returns
None otherwise.
Sourcepub fn set_i8(&mut self, value: Option<i8>) -> Result<(), PrimitiveError>
pub fn set_i8(&mut self, value: Option<i8>) -> Result<(), PrimitiveError>
Sets the inner value of the Primitive enum if variant matches.
Sourcepub fn set_i16(&mut self, value: Option<i16>) -> Result<(), PrimitiveError>
pub fn set_i16(&mut self, value: Option<i16>) -> Result<(), PrimitiveError>
Sets the inner value of the Primitive enum if variant matches.
Sourcepub fn set_i32(&mut self, value: Option<i32>) -> Result<(), PrimitiveError>
pub fn set_i32(&mut self, value: Option<i32>) -> Result<(), PrimitiveError>
Sets the inner value of the Primitive enum if variant matches.
Sourcepub fn set_i64(&mut self, value: Option<i64>) -> Result<(), PrimitiveError>
pub fn set_i64(&mut self, value: Option<i64>) -> Result<(), PrimitiveError>
Sets the inner value of the Primitive enum if variant matches.
Sourcepub fn set_i128(&mut self, value: Option<i128>) -> Result<(), PrimitiveError>
pub fn set_i128(&mut self, value: Option<i128>) -> Result<(), PrimitiveError>
Sets the inner value of the Primitive enum if variant matches.
Sourcepub fn set_u8(&mut self, value: Option<u8>) -> Result<(), PrimitiveError>
pub fn set_u8(&mut self, value: Option<u8>) -> Result<(), PrimitiveError>
Sets the inner value of the Primitive enum if variant matches.
Sourcepub fn set_u16(&mut self, value: Option<u16>) -> Result<(), PrimitiveError>
pub fn set_u16(&mut self, value: Option<u16>) -> Result<(), PrimitiveError>
Sets the inner value of the Primitive enum if variant matches.
Sourcepub fn set_u32(&mut self, value: Option<u32>) -> Result<(), PrimitiveError>
pub fn set_u32(&mut self, value: Option<u32>) -> Result<(), PrimitiveError>
Sets the inner value of the Primitive enum if variant matches.
Sourcepub fn set_u64(&mut self, value: Option<u64>) -> Result<(), PrimitiveError>
pub fn set_u64(&mut self, value: Option<u64>) -> Result<(), PrimitiveError>
Sets the inner value of the Primitive enum if variant matches.
Sourcepub fn set_u128(&mut self, value: Option<u128>) -> Result<(), PrimitiveError>
pub fn set_u128(&mut self, value: Option<u128>) -> Result<(), PrimitiveError>
Sets the inner value of the Primitive enum if variant matches.
Sourcepub fn set_u256(&mut self, value: Option<U256>) -> Result<(), PrimitiveError>
pub fn set_u256(&mut self, value: Option<U256>) -> Result<(), PrimitiveError>
Sets the inner value of the Primitive enum if variant matches.
Sourcepub fn set_bool(&mut self, value: Option<bool>) -> Result<(), PrimitiveError>
pub fn set_bool(&mut self, value: Option<bool>) -> Result<(), PrimitiveError>
Sets the inner value of the Primitive enum if variant matches.
Sourcepub fn set_felt252(&mut self, value: Option<Felt>) -> Result<(), PrimitiveError>
pub fn set_felt252(&mut self, value: Option<Felt>) -> Result<(), PrimitiveError>
Sets the inner value of the Primitive enum if variant matches.
Sourcepub fn set_class_hash(
&mut self,
value: Option<Felt>,
) -> Result<(), PrimitiveError>
pub fn set_class_hash( &mut self, value: Option<Felt>, ) -> Result<(), PrimitiveError>
Sets the inner value of the Primitive enum if variant matches.
Sourcepub fn set_contract_address(
&mut self,
value: Option<Felt>,
) -> Result<(), PrimitiveError>
pub fn set_contract_address( &mut self, value: Option<Felt>, ) -> Result<(), PrimitiveError>
Sets the inner value of the Primitive enum if variant matches.
Sourcepub fn set_eth_address(
&mut self,
value: Option<Felt>,
) -> Result<(), PrimitiveError>
pub fn set_eth_address( &mut self, value: Option<Felt>, ) -> Result<(), PrimitiveError>
Sets the inner value of the Primitive enum if variant matches.
pub fn to_numeric(&self) -> usize
pub fn from_numeric(value: usize) -> Option<Self>
pub fn to_sql_type(&self) -> SqlType
pub fn to_sql_value(&self) -> String
pub fn from_sql_value(&mut self, value: &str) -> Result<(), PrimitiveError>
Sourcepub fn to_json_value(&self) -> Result<JsonValue, PrimitiveError>
pub fn to_json_value(&self) -> Result<JsonValue, PrimitiveError>
Convert to JSON Value with proper type representation
Sourcepub fn from_json_value(
&mut self,
value: JsonValue,
) -> Result<(), PrimitiveError>
pub fn from_json_value( &mut self, value: JsonValue, ) -> Result<(), PrimitiveError>
Parse from JSON Value with proper type validation
pub fn deserialize( &mut self, felts: &mut Vec<Felt>, ) -> Result<(), PrimitiveError>
pub fn serialize(&self) -> Result<Vec<Felt>, PrimitiveError>
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Primitive
impl<'de> Deserialize<'de> for Primitive
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>,
Source§impl IntoEnumIterator for Primitive
impl IntoEnumIterator for Primitive
type Iterator = PrimitiveIter
fn iter() -> PrimitiveIter ⓘ
Source§impl Ord for Primitive
impl Ord for Primitive
Source§impl PartialOrd for Primitive
impl PartialOrd for Primitive
impl Copy for Primitive
impl Eq for Primitive
impl StructuralPartialEq for Primitive
Auto Trait Implementations§
impl Freeze for Primitive
impl RefUnwindSafe for Primitive
impl Send for Primitive
impl Sync for Primitive
impl Unpin for Primitive
impl UnwindSafe for Primitive
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
Source§impl<T> Casing<T> for T
impl<T> Casing<T> for T
Source§fn to_case(&self, case: Case<'_>) -> String
fn to_case(&self, case: Case<'_>) -> String
self and create a new
String with the same pattern and delimeter as case. It will split on boundaries
defined at Boundary::defaults(). Read moreSource§fn with_boundaries(&self, bs: &[Boundary]) -> StateConverter<'_, T>
fn with_boundaries(&self, bs: &[Boundary]) -> StateConverter<'_, T>
StateConverter struct initialized with the boundaries
provided. Read moreSource§fn without_boundaries(&self, bs: &[Boundary]) -> StateConverter<'_, T>
fn without_boundaries(&self, bs: &[Boundary]) -> StateConverter<'_, T>
StateConverter struct initialized without the boundaries
provided. Read moreSource§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
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
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>
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>
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