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§
sourcefn upcast(&self) -> &dyn SignatureSpecializationContext
fn upcast(&self) -> &dyn SignatureSpecializationContext
Upcasting to the SignatureSpecializationContext, since trait upcasting is still experimental.
sourcefn try_get_function(&self, function_id: &FunctionId) -> Option<Function>
fn try_get_function(&self, function_id: &FunctionId) -> Option<Function>
Returns the function object associated with the given FunctionId.
Provided Methods§
sourcefn get_function(
&self,
function_id: &FunctionId,
) -> Result<Function, SpecializationError>
fn get_function( &self, function_id: &FunctionId, ) -> Result<Function, SpecializationError>
Wraps Self::try_get_function with a result object.