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>