Skip to main content

Erase

Trait Erase 

Source
pub trait Erase<T: Copy> {
    type Output;

    // Required method
    fn erase<K: MaxSimKernel<T> + 'static>(self, kernel: K) -> Self::Output;
}
Expand description

“Bring your own type erasure” visitor: the factory hands a concrete kernel to Erase::erase, which decides how to package it (e.g. as Box<dyn MaxSimKernel<T>> via BoxErase, a chamfer-only closure, a batched evaluator, …).

Required Associated Types§

Required Methods§

Source

fn erase<K: MaxSimKernel<T> + 'static>(self, kernel: K) -> Self::Output

K is generic so the body sees its concrete type and the compiler can inline it.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<T: Copy + 'static> Erase<T> for BoxErase