cairo_lang_sierra::extensions::lib_func

Trait SpecializationContext

source
pub trait SpecializationContext: SignatureSpecializationContext {
    // Required methods
    fn upcast(&self) -> &dyn SignatureSpecializationContext;
    fn try_get_function(&self, function_id: &FunctionId) -> Option<Function>;

    // Provided method
    fn get_function(
        &self,
        function_id: &FunctionId,
    ) -> Result<Function, SpecializationError> { ... }
}
Expand description

Trait for the specialization of full libfuncs.

Required Methods§

source

fn upcast(&self) -> &dyn SignatureSpecializationContext

Upcasting to the SignatureSpecializationContext, since trait upcasting is still experimental.

source

fn try_get_function(&self, function_id: &FunctionId) -> Option<Function>

Returns the function object associated with the given FunctionId.

Provided Methods§

source

fn get_function( &self, function_id: &FunctionId, ) -> Result<Function, SpecializationError>

Wraps Self::try_get_function with a result object.

Implementors§