Enum clarity_repl::clarity::types::Value [−][src]
Variants
Int(i128)
UInt(u128)
Bool(bool)
Sequence(SequenceData)
Principal(PrincipalData)
Tuple(TupleData)
Optional(OptionalData)
Response(ResponseData)
Implementations
impl Value
[src]
pub fn deserialize_read<R: Read>(
r: &mut R,
expected_type: Option<&TypeSignature>
) -> Result<Value, SerializationError>
[src]
r: &mut R,
expected_type: Option<&TypeSignature>
) -> Result<Value, SerializationError>
pub fn serialize_write<W: Write>(&self, w: &mut W) -> Result<()>
[src]
pub fn try_deserialize_bytes(
bytes: &Vec<u8>,
expected: &TypeSignature
) -> Result<Value, SerializationError>
[src]
bytes: &Vec<u8>,
expected: &TypeSignature
) -> Result<Value, SerializationError>
This function attempts to deserialize a hex string into a Clarity Value.
The expected_type
parameter determines whether or not the deserializer should expect (and enforce)
a particular type. ClarityDB
uses this to ensure that lists, tuples, etc. loaded from the database
have their max-length and other type information set by the type declarations in the contract.
If passed None
, the deserializer will construct the values as if they were literals in the contract, e.g.,
list max length = the length of the list.
pub fn try_deserialize_hex(
hex: &str,
expected: &TypeSignature
) -> Result<Value, SerializationError>
[src]
hex: &str,
expected: &TypeSignature
) -> Result<Value, SerializationError>
pub fn try_deserialize_bytes_untyped(
bytes: &Vec<u8>
) -> Result<Value, SerializationError>
[src]
bytes: &Vec<u8>
) -> Result<Value, SerializationError>
pub fn try_deserialize_hex_untyped(
hex: &str
) -> Result<Value, SerializationError>
[src]
hex: &str
) -> Result<Value, SerializationError>
pub fn deserialize(hex: &str, expected: &TypeSignature) -> Self
[src]
impl Value
[src]
pub fn some(data: Value) -> Result<Value>
[src]
pub fn none() -> Value
[src]
pub fn okay_true() -> Value
[src]
pub fn err_uint(ecode: u128) -> Value
[src]
pub fn err_none() -> Value
[src]
pub fn okay(data: Value) -> Result<Value>
[src]
pub fn error(data: Value) -> Result<Value>
[src]
pub fn size(&self) -> u32
[src]
pub fn depth(&self) -> u8
[src]
pub fn list_with_type(
list_data: Vec<Value>,
expected_type: ListTypeData
) -> Result<Value>
[src]
list_data: Vec<Value>,
expected_type: ListTypeData
) -> Result<Value>
Invariant: the supplied Values have already been “checked”, i.e., it’s a valid Value object this invariant is enforced through the Value constructors, each of which checks to ensure that any typing data is correct.
pub fn list_from(list_data: Vec<Value>) -> Result<Value>
[src]
pub fn buff_from(buff_data: Vec<u8>) -> Result<Value>
[src]
pub fn buff_from_byte(byte: u8) -> Value
[src]
pub fn string_ascii_from_bytes(bytes: Vec<u8>) -> Result<Value>
[src]
pub fn string_utf8_from_string_utf8_literal(
tokenized_str: String
) -> Result<Value>
[src]
tokenized_str: String
) -> Result<Value>
pub fn string_utf8_from_bytes(bytes: Vec<u8>) -> Result<Value>
[src]
pub fn expect_ascii(self) -> String
[src]
pub fn expect_u128(self) -> u128
[src]
pub fn expect_i128(self) -> i128
[src]
pub fn expect_buff(self, sz: usize) -> Vec<u8>
[src]
pub fn expect_list(self) -> Vec<Value>
[src]
pub fn expect_buff_padded(self, sz: usize, pad: u8) -> Vec<u8>
[src]
pub fn expect_bool(self) -> bool
[src]
pub fn expect_tuple(self) -> TupleData
[src]
pub fn expect_optional(self) -> Option<Value>
[src]
pub fn expect_principal(self) -> PrincipalData
[src]
pub fn expect_result(self) -> Result<Value, Value>
[src]
pub fn expect_result_ok(self) -> Value
[src]
pub fn expect_result_err(self) -> Value
[src]
Trait Implementations
impl ClarityDeserializable<Value> for Value
[src]
fn deserialize(hex: &str) -> Self
[src]
impl ClaritySerializable for Value
[src]
impl Clone for Value
[src]
impl Debug for Value
[src]
impl<'de> Deserialize<'de> for Value
[src]
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
impl Display for Value
[src]
impl Eq for Value
[src]
impl From<&'_ Value> for TypePrefix
[src]
fn from(v: &Value) -> TypePrefix
[src]
impl From<PrincipalData> for Value
[src]
fn from(p: PrincipalData) -> Self
[src]
impl From<QualifiedContractIdentifier> for Value
[src]
fn from(principal: QualifiedContractIdentifier) -> Self
[src]
impl From<StandardPrincipalData> for Value
[src]
fn from(principal: StandardPrincipalData) -> Self
[src]
impl From<TupleData> for Value
[src]
impl Into<Value> for ShortReturnType
[src]
impl MemoryConsumer for Value
[src]
fn get_memory_use(&self) -> u64
[src]
impl PartialEq<Value> for Value
[src]
impl SequencedValue<Value> for ListData
[src]
fn items(&self) -> &Vec<Value>
[src]
fn drained_items(&mut self) -> Vec<Value>
[src]
fn type_signature(&self) -> TypeSignature
[src]
fn to_value(v: &Value) -> Value
[src]
fn atom_values(&mut self) -> Vec<SymbolicExpression>
[src]
impl Serialize for Value
[src]
fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where
__S: Serializer,
[src]
__S: Serializer,
impl StructuralEq for Value
[src]
impl StructuralPartialEq for Value
[src]
Auto Trait Implementations
impl RefUnwindSafe for Value
impl Send for Value
impl Sync for Value
impl Unpin for Value
impl UnwindSafe for Value
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> Deserialize<'de>,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,