1 |
use giterated_models::{
|
2 |
error::OperationError,
|
3 |
operation::{GiteratedObject, GiteratedOperation, Object, ObjectBackend, ObjectRequestError},
|
4 |
};
|
5 |
use std::fmt::Debug;
|
6 |
|
7 |
#[derive(Clone, Debug)]
|
8 |
pub struct CacheBackend;
|
9 |
|
10 |
#[async_trait::async_trait]
|
11 |
impl ObjectBackend for CacheBackend {
|
12 |
async fn object_operation<O: GiteratedObject + Debug, D: GiteratedOperation<O> + Debug>(
|
13 |
&self,
|
14 |
_object: O,
|
15 |
_operation: D,
|
16 |
) -> Result<D::Success, OperationError<D::Failure>> {
|
17 |
|
18 |
Err(OperationError::Unhandled)
|
19 |
}
|
20 |
|
21 |
async fn get_object<O: GiteratedObject + Debug>(
|
22 |
&self,
|
23 |
_object_str: &str,
|
24 |
) -> Result<Object<O, Self>, OperationError<ObjectRequestError>> {
|
25 |
Err(OperationError::Unhandled)
|
26 |
}
|
27 |
}
|
28 |
|