cairo_lang_sierra::extensions::lib_func

Trait NamedLibfunc

source
pub trait NamedLibfunc: Default {
    type Concrete: ConcreteLibfunc;

    const STR_ID: &'static str;

    // Required methods
    fn specialize_signature(
        &self,
        context: &dyn SignatureSpecializationContext,
        args: &[GenericArg],
    ) -> Result<LibfuncSignature, SpecializationError>;
    fn specialize(
        &self,
        context: &dyn SpecializationContext,
        args: &[GenericArg],
    ) -> Result<Self::Concrete, SpecializationError>;
}
Expand description

Trait for implementing a specialization generator with a simple id.

Required Associated Constants§

source

const STR_ID: &'static str

Required Associated Types§

Required Methods§

source

fn specialize_signature( &self, context: &dyn SignatureSpecializationContext, args: &[GenericArg], ) -> Result<LibfuncSignature, SpecializationError>

Creates the specialization of the libfunc’s signature with the template arguments.

source

fn specialize( &self, context: &dyn SpecializationContext, args: &[GenericArg], ) -> Result<Self::Concrete, SpecializationError>

Creates the specialization with the template arguments.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

source§

impl NamedLibfunc for ArraySnapshotMultiPopBackLibfunc

source§

const STR_ID: &'static str = "array_snapshot_multi_pop_back"

source§

type Concrete = ConcreteMultiPopLibfunc

source§

impl NamedLibfunc for ArraySnapshotMultiPopFrontLibfunc

source§

const STR_ID: &'static str = "array_snapshot_multi_pop_front"

source§

type Concrete = ConcreteMultiPopLibfunc

source§

impl NamedLibfunc for BoundedIntConstrainLibfunc

source§

const STR_ID: &'static str = "bounded_int_constrain"

source§

type Concrete = BoundedIntConstrainConcreteLibfunc

source§

impl NamedLibfunc for BoundedIntDivRemLibfunc

source§

const STR_ID: &'static str = "bounded_int_div_rem"

source§

type Concrete = BoundedIntDivRemConcreteLibfunc

source§

impl NamedLibfunc for DowncastLibfunc

source§

const STR_ID: &'static str = "downcast"

source§

type Concrete = DowncastConcreteLibfunc

source§

impl NamedLibfunc for GetOutputLibFunc

source§

const STR_ID: &'static str = "get_circuit_output"

source§

type Concrete = ConcreteGetOutputLibFunc

source§

impl NamedLibfunc for U96LimbsLessThanGuaranteeVerifyLibfunc

source§

const STR_ID: &'static str = "u96_limbs_less_than_guarantee_verify"

source§

type Concrete = ConcreteU96LimbsLessThanGuaranteeVerifyLibfunc

source§

impl NamedLibfunc for ConstAsBoxLibfunc

source§

const STR_ID: &'static str = "const_as_box"

source§

type Concrete = ConstAsBoxConcreteLibfunc

source§

impl NamedLibfunc for ConstAsImmediateLibfunc

source§

const STR_ID: &'static str = "const_as_immediate"

source§

type Concrete = ConstAsImmediateConcreteLibfunc

source§

impl NamedLibfunc for CouponBuyLibfunc

source§

impl NamedLibfunc for CouponRefundLibfunc

source§

impl NamedLibfunc for EnumFromBoundedIntLibfunc

source§

const STR_ID: &'static str = "enum_from_bounded_int"

source§

type Concrete = EnumFromBoundedIntConcreteLibfunc

source§

impl NamedLibfunc for EnumInitLibfunc

source§

const STR_ID: &'static str = "enum_init"

source§

type Concrete = EnumInitConcreteLibfunc

source§

impl NamedLibfunc for Felt252ConstLibfunc

source§

const STR_ID: &'static str = "felt252_const"

source§

type Concrete = Felt252ConstConcreteLibfunc

source§

impl NamedLibfunc for CouponCallLibfunc

source§

impl NamedLibfunc for FunctionCallLibfunc

source§

impl NamedLibfunc for CheatcodeLibfunc

source§

const STR_ID: &'static str = "cheatcode"

source§

type Concrete = CheatcodeConcreteLibfunc

source§

impl<T: ConstGenLibfunc> NamedLibfunc for WrapConstGenLibfunc<T>

source§

const STR_ID: &'static str = <T as ConstGenLibfunc>::STR_ID

source§

type Concrete = SignatureAndConstConcreteLibfunc

source§

impl<T: SignatureAndTypeGenericLibfunc> NamedLibfunc for WrapSignatureAndTypeGenericLibfunc<T>

source§

const STR_ID: &'static str = <T as SignatureAndTypeGenericLibfunc>::STR_ID

source§

type Concrete = SignatureAndTypeConcreteLibfunc

source§

impl<T: SignatureOnlyGenericLibfunc> NamedLibfunc for T

source§

const STR_ID: &'static str = <Self as SignatureOnlyGenericLibfunc>::STR_ID

source§

type Concrete = SignatureOnlyConcreteLibfunc

source§

impl<TIntTraits: IntTraits> NamedLibfunc for IntConstLibfunc<TIntTraits>

source§

const STR_ID: &'static str = TIntTraits::CONST

source§

type Concrete = IntConstConcreteLibfunc<TIntTraits>