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