pub trait Strategy<T: Send + Sync>: Send + Sync {
fn for_field(field: &T) -> Self
where
Self: Sized;
}
pub struct SparseField<Field> {
pub field: Field,
}
impl<T: Send + Sync + Clone> Strategy<T> for SparseField<T> {
#[inline(always)]
fn for_field(field: &'_ T) -> Self {
SparseField {
field: field.clone(),
}
}
}
pub struct LocalField<Field> {
pub field: Field,
}
impl<T: Send + Sync + Clone> Strategy<T> for LocalField<T> {
#[inline(always)]
fn for_field(field: &T) -> Self {
LocalField {
field: field.clone(),
}
}
}