Struct clarity_repl::clarity::contexts::ContractContext
source · [−]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,
}
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
sourceimpl ContractContext
impl ContractContext
pub fn new(contract_identifier: QualifiedContractIdentifier) -> Self
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
Trait Implementations
sourceimpl Clone for ContractContext
impl Clone for ContractContext
sourcefn clone(&self) -> ContractContext
fn clone(&self) -> ContractContext
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresourceimpl<'de> Deserialize<'de> for ContractContext
impl<'de> Deserialize<'de> for ContractContext
sourcefn 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>,
Deserialize this value from the given Serde deserializer. Read more
sourceimpl Serialize for ContractContext
impl Serialize for ContractContext
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
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more