-
Notifications
You must be signed in to change notification settings - Fork 0
We need to be able to pass more context to the model #1
Copy link
Copy link
Open
Description
I'm trying to use redux to implement a compression mechanism for sophisticated data structures. For this purpose, I need to be able to pass potentially complex context to the model, not just usize.
For this purpose, I'd need something along the lines of:
/// Values of type `T` contains all the necessary information we need to write to
/// the bit stream. Values are eventually converted to a `usize` for actual writing.
struct Codec<T> where T: Hash + Eq + Into<usize> {
// ...
}
impl<T> Codec<T> where T: Hash + Eq + Into<usize> {
fn compress_symbol(&mut self, context: T, output: &mut BitWrite) -> Result<()>;
}
// Similar changes to `Model`.Instead of the current implementation that hardcodes usize everywhere.
What do you think?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels