mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-06 19:56:42 +01:00
wip: refactor pt.34 (35e) more traits, fewer structs
This commit is contained in:
parent
cbbecc5aba
commit
beca1a6ade
19 changed files with 361 additions and 379 deletions
|
|
@ -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> (
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue