1 |
pub trait FromOperationState<O, D>: Sized {
|
2 |
fn from_operation_state(
|
3 |
state: &mut State,
|
4 |
object: &O,
|
5 |
operation: &D,
|
6 |
) -> Result<Self, OperationError<anyhow::Error>>;
|
7 |
}
|
8 |
|
9 |
pub struct StateExtractor<T>(T);
|
10 |
|
11 |
impl<T: FromState> FromState for StateExtractor<T> {
|
12 |
fn from_state(state: &mut State) -> Result<Self, anyhow::Error> {
|
13 |
todo!()
|
14 |
}
|
15 |
}
|
16 |
|