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