pub struct ContractAnalysis {
Show 18 fields pub contract_identifier: QualifiedContractIdentifier, pub private_function_types: BTreeMap<ClarityName, FunctionType>, pub variable_types: BTreeMap<ClarityName, TypeSignature>, pub public_function_types: BTreeMap<ClarityName, FunctionType>, pub read_only_function_types: BTreeMap<ClarityName, FunctionType>, pub map_types: BTreeMap<ClarityName, (TypeSignature, TypeSignature)>, pub persisted_variable_types: BTreeMap<ClarityName, TypeSignature>, pub fungible_tokens: BTreeSet<ClarityName>, pub non_fungible_tokens: BTreeMap<ClarityName, TypeSignature>, pub defined_traits: BTreeMap<ClarityName, BTreeMap<ClarityName, FunctionSignature>>, pub implemented_traits: BTreeSet<TraitIdentifier>, pub contract_interface: Option<ContractInterface>, pub is_cost_contract_eligible: bool, pub epoch: StacksEpochId, pub clarity_version: ClarityVersion, pub expressions: Vec<SymbolicExpression>, pub type_map: Option<TypeMap>, pub cost_track: Option<LimitedCostTracker>,
}

Fields§

§contract_identifier: QualifiedContractIdentifier§private_function_types: BTreeMap<ClarityName, FunctionType>§variable_types: BTreeMap<ClarityName, TypeSignature>§public_function_types: BTreeMap<ClarityName, FunctionType>§read_only_function_types: BTreeMap<ClarityName, FunctionType>§map_types: BTreeMap<ClarityName, (TypeSignature, TypeSignature)>§persisted_variable_types: BTreeMap<ClarityName, TypeSignature>§fungible_tokens: BTreeSet<ClarityName>§non_fungible_tokens: BTreeMap<ClarityName, TypeSignature>§defined_traits: BTreeMap<ClarityName, BTreeMap<ClarityName, FunctionSignature>>§implemented_traits: BTreeSet<TraitIdentifier>§contract_interface: Option<ContractInterface>§is_cost_contract_eligible: bool§epoch: StacksEpochId§clarity_version: ClarityVersion§expressions: Vec<SymbolicExpression>§type_map: Option<TypeMap>§cost_track: Option<LimitedCostTracker>

Implementations§

§

impl ContractAnalysis

pub fn new( contract_identifier: QualifiedContractIdentifier, expressions: Vec<SymbolicExpression>, cost_track: LimitedCostTracker, epoch: StacksEpochId, clarity_version: ClarityVersion ) -> ContractAnalysis

pub fn take_contract_cost_tracker(&mut self) -> LimitedCostTracker

pub fn replace_contract_cost_tracker(&mut self, cost_track: LimitedCostTracker)

pub fn add_map_type( &mut self, name: ClarityName, key_type: TypeSignature, map_type: TypeSignature )

pub fn add_variable_type( &mut self, name: ClarityName, variable_type: TypeSignature )

pub fn add_persisted_variable_type( &mut self, name: ClarityName, persisted_variable_type: TypeSignature )

pub fn add_read_only_function( &mut self, name: ClarityName, function_type: FunctionType )

pub fn add_public_function( &mut self, name: ClarityName, function_type: FunctionType )

pub fn add_private_function( &mut self, name: ClarityName, function_type: FunctionType )

pub fn add_non_fungible_token( &mut self, name: ClarityName, nft_type: TypeSignature )

pub fn add_fungible_token(&mut self, name: ClarityName)

pub fn add_defined_trait( &mut self, name: ClarityName, function_types: BTreeMap<ClarityName, FunctionSignature> )

pub fn add_implemented_trait(&mut self, trait_identifier: TraitIdentifier)

pub fn get_public_function_type(&self, name: &str) -> Option<&FunctionType>

pub fn get_read_only_function_type(&self, name: &str) -> Option<&FunctionType>

pub fn get_private_function(&self, name: &str) -> Option<&FunctionType>

pub fn get_map_type( &self, name: &str ) -> Option<&(TypeSignature, TypeSignature)>

pub fn get_variable_type(&self, name: &str) -> Option<&TypeSignature>

pub fn get_persisted_variable_type(&self, name: &str) -> Option<&TypeSignature>

pub fn get_defined_trait( &self, name: &str ) -> Option<&BTreeMap<ClarityName, FunctionSignature>>

pub fn canonicalize_types(&mut self, epoch: &StacksEpochId)

Canonicalize all types in the contract analysis.

pub fn check_trait_compliance( &self, epoch: &StacksEpochId, trait_identifier: &TraitIdentifier, trait_definition: &BTreeMap<ClarityName, FunctionSignature> ) -> Result<(), CheckError>

Trait Implementations§

§

impl ClarityDeserializable<ContractAnalysis> for ContractAnalysis

§

impl ClaritySerializable for ContractAnalysis

§

fn serialize(&self) -> String

§

impl Clone for ContractAnalysis

§

fn clone(&self) -> ContractAnalysis

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
§

impl Debug for ContractAnalysis

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl<'de> Deserialize<'de> for ContractAnalysis

§

fn deserialize<__D>( __deserializer: __D ) -> Result<ContractAnalysis, <__D as Deserializer<'de>>::Error>where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
§

impl PartialEq for ContractAnalysis

§

fn eq(&self, other: &ContractAnalysis) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
§

impl Serialize for ContractAnalysis

§

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
§

impl StructuralPartialEq for ContractAnalysis

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

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
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more
source§

impl<T> DeserializeOwned for Twhere T: for<'de> Deserialize<'de>,