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