pub trait CacheStack: Sized {
type Cache;
// Required methods
fn slot_count(&self) -> usize;
fn into_slots(self) -> Vec<Option<Self::Cache>>;
fn from_slots(slots: Vec<Option<Self::Cache>>) -> Self;
}Expand description
The uniform interface a per-network cache collection exposes for the generic
Layers loop. The existing Mamba{1,2,3}Caches already provide it (under
caches_len/into_options/from_options).
Required Associated Types§
Required Methods§
Sourcefn slot_count(&self) -> usize
fn slot_count(&self) -> usize
Number of per-(virtual-)layer slots.
Sourcefn into_slots(self) -> Vec<Option<Self::Cache>>
fn into_slots(self) -> Vec<Option<Self::Cache>>
Move each slot into an Option so the loop can take without cloning.
Sourcefn from_slots(slots: Vec<Option<Self::Cache>>) -> Self
fn from_slots(slots: Vec<Option<Self::Cache>>) -> Self
Inverse of Self::into_slots.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".