wip: refactor pt.34 (35e) more traits, fewer structs

This commit is contained in:
🪞👃🪞 2024-11-15 01:44:51 +01:00
parent cbbecc5aba
commit beca1a6ade
19 changed files with 361 additions and 379 deletions

View file

@ -6,8 +6,11 @@ pub enum NextPrev {
Prev,
}
pub trait Execute<T> {
fn command (&mut self, command: T) -> Perhaps<T>;
}
pub trait Command<S>: Send + Sync + Sized {
fn translate (self, _: &S) -> Self { self }
fn execute (self, state: &mut S) -> Perhaps<Self>;
}
pub fn delegate <B, C: Command<S>, S> (