pub trait NamedLibfunc: Default {
type Concrete: ConcreteLibfunc;
const STR_ID: &'static str;
// Required methods
fn specialize_signature(
&self,
context: &dyn SignatureSpecializationContext,
args: &[GenericArg],
) -> Result<LibfuncSignature, SpecializationError>;
fn specialize(
&self,
context: &dyn SpecializationContext,
args: &[GenericArg],
) -> Result<Self::Concrete, SpecializationError>;
}
Expand description
Trait for implementing a specialization generator with a simple id.
Required Associated Constants§
Required Associated Types§
Required Methods§
sourcefn specialize_signature(
&self,
context: &dyn SignatureSpecializationContext,
args: &[GenericArg],
) -> Result<LibfuncSignature, SpecializationError>
fn specialize_signature( &self, context: &dyn SignatureSpecializationContext, args: &[GenericArg], ) -> Result<LibfuncSignature, SpecializationError>
Creates the specialization of the libfunc’s signature with the template arguments.
sourcefn specialize(
&self,
context: &dyn SpecializationContext,
args: &[GenericArg],
) -> Result<Self::Concrete, SpecializationError>
fn specialize( &self, context: &dyn SpecializationContext, args: &[GenericArg], ) -> Result<Self::Concrete, SpecializationError>
Creates the specialization with the template arguments.
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.