Struct clarity_repl::clarity::analysis::type_checker::contexts::ContractContext
source · [−]pub struct ContractContext {
pub implemented_traits: HashSet<TraitIdentifier>,
/* private fields */
}
Fields
implemented_traits: HashSet<TraitIdentifier>
Implementations
sourceimpl ContractContext
impl ContractContext
pub fn new() -> ContractContext
pub fn check_name_used(&self, name: &str) -> CheckResult<()>
pub fn ft_exists(&self, name: &str) -> bool
pub fn get_nft_type(&self, name: &str) -> Option<&TypeSignature>
pub fn add_public_function_type(
&mut self,
name: ClarityName,
func_type: FunctionType
) -> CheckResult<()>
pub fn add_read_only_function_type(
&mut self,
name: ClarityName,
func_type: FunctionType
) -> CheckResult<()>
pub fn add_private_function_type(
&mut self,
name: ClarityName,
func_type: FunctionType
) -> CheckResult<()>
pub fn add_map_type(
&mut self,
map_name: ClarityName,
map_type: (TypeSignature, TypeSignature)
) -> CheckResult<()>
pub fn add_variable_type(
&mut self,
const_name: ClarityName,
var_type: TypeSignature
) -> CheckResult<()>
pub fn add_persisted_variable_type(
&mut self,
var_name: ClarityName,
var_type: TypeSignature
) -> CheckResult<()>
pub fn add_ft(&mut self, token_name: ClarityName) -> CheckResult<()>
pub fn add_nft(
&mut self,
token_name: ClarityName,
token_type: TypeSignature
) -> CheckResult<()>
pub fn add_trait(
&mut self,
trait_name: ClarityName,
trait_signature: BTreeMap<ClarityName, FunctionSignature>
) -> CheckResult<()>
pub fn add_implemented_trait(
&mut self,
trait_identifier: TraitIdentifier
) -> CheckResult<()>
pub fn get_trait(
&self,
trait_name: &str
) -> Option<&BTreeMap<ClarityName, FunctionSignature>>
pub fn get_map_type(
&self,
map_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_function_type(&self, name: &str) -> Option<&FunctionType>
sourcepub fn into_contract_analysis(self, contract_analysis: &mut ContractAnalysis)
pub fn into_contract_analysis(self, contract_analysis: &mut ContractAnalysis)
This function consumes the ContractContext, and puts the relevant information into the provided ContractAnalysis
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>
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