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 more
sourceimpl<'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 T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
pub fn vzip(self) -> V
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more