JavaScript is disabled, refresh for a better experience. ambee/giterated

ambee/giterated

Git repository hosting, collaboration, and discovery for the Fediverse.

Fixed imports!

Amber - ⁨2⁩ years ago

parent: tbd commit: ⁨ef0e853

⁨giterated-daemon/src/cache_backend.rs⁩ - ⁨892⁩ bytes
Raw
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: D,
18 ) -> Result<D::Success, OperationError<D::Failure>> {
19 // We don't handle operations with this backend
20 Err(OperationError::Unhandled)
21 }
22
23 async fn get_object<O: GiteratedObject + Debug>(
24 &self,
25 _object_str: &str,
26 ) -> Result<Object<O, Self>, OperationError<ObjectRequestError>> {
27 Err(OperationError::Unhandled)
28 }
29 }
30