cairo_lang_sierra::extensions::types

Trait NamedType

Source
pub trait NamedType: Default {
    type Concrete: ConcreteType;

    const ID: GenericTypeId;

    // Required method
    fn specialize(
        &self,
        context: &dyn TypeSpecializationContext,
        args: &[GenericArg],
    ) -> Result<Self::Concrete, SpecializationError>;

    // Provided methods
    fn id() -> GenericTypeId { ... }
    fn concrete_type_long_id(generic_args: &[GenericArg]) -> ConcreteTypeLongId { ... }
}
Expand description

Trait for implementing a specialization generator with with a simple id.

Required Associated Constants§

Required Associated Types§

Required Methods§

Source

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

Creates the specialization with the template arguments.

Provided Methods§

Source

fn id() -> GenericTypeId

Returns the generic id of named types.

Source

fn concrete_type_long_id(generic_args: &[GenericArg]) -> ConcreteTypeLongId

Returns the long ID of the concrete type with ID as the generic ID and the given args.

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 NamedType for BoundedIntType

Source§

impl NamedType for AddModGate

Source§

impl NamedType for Circuit

Source§

impl NamedType for CircuitData

Source§

impl NamedType for CircuitDescriptor

Source§

impl NamedType for CircuitInput

Source§

impl NamedType for CircuitInputAccumulator

Source§

impl NamedType for CircuitOutputs

Source§

impl NamedType for CircuitPartialOutputs

Source§

impl NamedType for InverseGate

Source§

impl NamedType for MulModGate

Source§

impl NamedType for SubModGate

Source§

impl NamedType for U96LimbsLessThanGuarantee

Source§

impl NamedType for ConstType

Source§

impl NamedType for CouponType

Source§

impl NamedType for EnumType

Source§

impl NamedType for StructType

Source§

impl<T: GenericTypeArgGenericType> NamedType for GenericTypeArgGenericTypeWrapper<T>

Source§

impl<T: NoGenericArgsGenericType> NamedType for T

Source§

const ID: GenericTypeId = <Self as NoGenericArgsGenericType>::ID

Source§

type Concrete = InfoOnlyConcreteType