cairo_lang_sierra::extensions::modules::consts

Trait ConstGenLibfunc

source
pub trait ConstGenLibfunc: Default {
    const STR_ID: &'static str;
    const GENERIC_TYPE_ID: GenericTypeId;

    // Required method
    fn bound() -> BigInt;
}
Expand description

Trait for implementing a library function that returns a const of a given type.

Required Associated Constants§

source

const STR_ID: &'static str

The library function id.

source

const GENERIC_TYPE_ID: GenericTypeId

The id of the generic type to implement the library functions for.

Required Methods§

source

fn bound() -> BigInt

The bound on the value of the type.

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 ConstGenLibfunc for Bytes31ConstLibfuncWrapped

source§

const STR_ID: &'static str = "bytes31_const"

source§

const GENERIC_TYPE_ID: GenericTypeId = <Bytes31Type as NoGenericArgsGenericType>::ID

source§

impl ConstGenLibfunc for ClassHashConstLibfuncWrapped

source§

const STR_ID: &'static str = "class_hash_const"

source§

const GENERIC_TYPE_ID: GenericTypeId = <ClassHashType as NoGenericArgsGenericType>::ID

source§

impl ConstGenLibfunc for ContractAddressConstLibfuncWrapped

source§

const STR_ID: &'static str = "contract_address_const"

source§

const GENERIC_TYPE_ID: GenericTypeId = <ContractAddressType as NoGenericArgsGenericType>::ID

source§

impl ConstGenLibfunc for StorageBaseAddressConstLibfuncWrapped

source§

const STR_ID: &'static str = ("storage_base_address_const")

source§

const GENERIC_TYPE_ID: GenericTypeId = <StorageBaseAddressType as NoGenericArgsGenericType>::ID