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§