Enum clarity_repl::clarity::vm::types::FunctionType
source · pub enum FunctionType {
Variadic(TypeSignature, TypeSignature),
Fixed(FixedFunction),
UnionArgs(Vec<TypeSignature>, TypeSignature),
ArithmeticVariadic,
ArithmeticUnary,
ArithmeticBinary,
ArithmeticComparison,
Binary(FunctionArgSignature, FunctionArgSignature, FunctionReturnsSignature),
}Variants§
Variadic(TypeSignature, TypeSignature)
Fixed(FixedFunction)
UnionArgs(Vec<TypeSignature>, TypeSignature)
ArithmeticVariadic
ArithmeticUnary
ArithmeticBinary
ArithmeticComparison
Binary(FunctionArgSignature, FunctionArgSignature, FunctionReturnsSignature)
Implementations§
source§impl FunctionType
impl FunctionType
pub fn canonicalize(&self, epoch: &StacksEpochId) -> FunctionType
source§impl FunctionType
impl FunctionType
pub fn check_args_2_05<T>( &self, accounting: &mut T, args: &[TypeSignature] ) -> Result<TypeSignature, CheckError>where T: CostTracker,
pub fn check_args_by_allowing_trait_cast_2_05( &self, db: &mut AnalysisDatabase<'_>, func_args: &[Value] ) -> Result<TypeSignature, CheckError>
source§impl FunctionType
impl FunctionType
pub fn check_args_2_1<T>( &self, accounting: &mut T, args: &[TypeSignature], clarity_version: ClarityVersion ) -> Result<TypeSignature, CheckError>where T: CostTracker,
sourcepub fn principal_to_callable_type(
&self,
value: &Value,
depth: u8,
clarity_version: ClarityVersion
) -> Result<TypeSignature, CheckError>
pub fn principal_to_callable_type( &self, value: &Value, depth: u8, clarity_version: ClarityVersion ) -> Result<TypeSignature, CheckError>
Returns the type of value, after converting any contract principal
types to callable types. In an initial transaction, arguments are typed
as contract principals, but they must be principal literals, so they
may be used to call into a contract.
sourcepub fn check_args_by_allowing_trait_cast_2_1(
&self,
db: &mut AnalysisDatabase<'_>,
clarity_version: ClarityVersion,
func_args: &[Value]
) -> Result<TypeSignature, CheckError>
pub fn check_args_by_allowing_trait_cast_2_1( &self, db: &mut AnalysisDatabase<'_>, clarity_version: ClarityVersion, func_args: &[Value] ) -> Result<TypeSignature, CheckError>
This method is only used by StacksChainState::can_include_tx. The cost of evaluating these type checks are not tracked. WARNING: This is not consensus-critical code, and should never be called from consensus-critical code.
source§impl FunctionType
impl FunctionType
pub fn check_args<T>( &self, accounting: &mut T, args: &[TypeSignature], epoch: StacksEpochId, clarity_version: ClarityVersion ) -> Result<TypeSignature, CheckError>where T: CostTracker,
pub fn check_args_by_allowing_trait_cast( &self, db: &mut AnalysisDatabase<'_>, func_args: &[Value], epoch: StacksEpochId, clarity_version: ClarityVersion ) -> Result<TypeSignature, CheckError>
Trait Implementations§
source§impl Clone for FunctionType
impl Clone for FunctionType
source§fn clone(&self) -> FunctionType
fn clone(&self) -> FunctionType
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 moresource§impl Debug for FunctionType
impl Debug for FunctionType
source§impl<'de> Deserialize<'de> for FunctionType
impl<'de> Deserialize<'de> for FunctionType
source§fn deserialize<__D>(
__deserializer: __D
) -> Result<FunctionType, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>( __deserializer: __D ) -> Result<FunctionType, <__D as Deserializer<'de>>::Error>where __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl PartialEq for FunctionType
impl PartialEq for FunctionType
source§fn eq(&self, other: &FunctionType) -> bool
fn eq(&self, other: &FunctionType) -> bool
This method tests for
self and other values to be equal, and is used
by ==.source§impl Serialize for FunctionType
impl Serialize for FunctionType
source§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
impl Eq for FunctionType
impl StructuralEq for FunctionType
impl StructuralPartialEq for FunctionType
Auto Trait Implementations§
impl RefUnwindSafe for FunctionType
impl Send for FunctionType
impl Sync for FunctionType
impl Unpin for FunctionType
impl UnwindSafe for FunctionType
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
source§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.