Struct stacks_rpc_client::clarity::vm::contexts::ContractContext
pub struct ContractContext {
pub contract_identifier: QualifiedContractIdentifier,
pub variables: HashMap<ClarityName, Value>,
pub functions: HashMap<ClarityName, DefinedFunction>,
pub defined_traits: HashMap<ClarityName, BTreeMap<ClarityName, FunctionSignature>>,
pub implemented_traits: HashSet<TraitIdentifier>,
pub persisted_names: HashSet<ClarityName>,
pub meta_data_map: HashMap<ClarityName, DataMapMetadata>,
pub meta_data_var: HashMap<ClarityName, DataVariableMetadata>,
pub meta_nft: HashMap<ClarityName, NonFungibleTokenMetadata>,
pub meta_ft: HashMap<ClarityName, FungibleTokenMetadata>,
pub data_size: u64,
/* private fields */
}
Fields§
§contract_identifier: QualifiedContractIdentifier
§variables: HashMap<ClarityName, Value>
§functions: HashMap<ClarityName, DefinedFunction>
§defined_traits: HashMap<ClarityName, BTreeMap<ClarityName, FunctionSignature>>
§implemented_traits: HashSet<TraitIdentifier>
§persisted_names: HashSet<ClarityName>
§meta_data_map: HashMap<ClarityName, DataMapMetadata>
§meta_data_var: HashMap<ClarityName, DataVariableMetadata>
§meta_nft: HashMap<ClarityName, NonFungibleTokenMetadata>
§meta_ft: HashMap<ClarityName, FungibleTokenMetadata>
§data_size: u64
Implementations§
§impl ContractContext
impl ContractContext
pub fn new( contract_identifier: QualifiedContractIdentifier, clarity_version: ClarityVersion ) -> ContractContext
pub fn lookup_variable(&self, name: &str) -> Option<&Value>
pub fn lookup_function(&self, name: &str) -> Option<DefinedFunction>
pub fn lookup_trait_definition( &self, name: &str ) -> Option<BTreeMap<ClarityName, FunctionSignature>>
pub fn is_explicitly_implementing_trait( &self, trait_identifier: &TraitIdentifier ) -> bool
pub fn is_name_used(&self, name: &str) -> bool
pub fn get_clarity_version(&self) -> &ClarityVersion
pub fn canonicalize_types(&mut self, epoch: &StacksEpochId)
pub fn canonicalize_types(&mut self, epoch: &StacksEpochId)
Canonicalize the types for the specified epoch. Only functions and defined traits are exposed externally, so other types are not canonicalized.
Trait Implementations§
§impl Clone for ContractContext
impl Clone for ContractContext
§fn clone(&self) -> ContractContext
fn clone(&self) -> ContractContext
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 more§impl<'de> Deserialize<'de> for ContractContext
impl<'de> Deserialize<'de> for ContractContext
§fn deserialize<__D>(
__deserializer: __D
) -> Result<ContractContext, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>( __deserializer: __D ) -> Result<ContractContext, <__D as Deserializer<'de>>::Error>where __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
§impl Serialize for ContractContext
impl Serialize for ContractContext
§fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>( &self, __serializer: __S ) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where __S: Serializer,
Serialize this value into the given Serde serializer. Read more
Auto Trait Implementations§
impl RefUnwindSafe for ContractContext
impl Send for ContractContext
impl Sync for ContractContext
impl Unpin for ContractContext
impl UnwindSafe for ContractContext
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