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

ambee/giterated

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

More progress :)

Amber - ⁨1⁩ year ago

parent: tbd commit: ⁨92c3f32

⁨giterated-models/src/object_backend.rs⁩ - ⁨856⁩ bytes
Raw
1 use crate::{
2 error::OperationError,
3 object::{GiteratedObject, Object, ObjectRequestError},
4 operation::{GiteratedOperation, OperationState},
5 };
6
7 use std::fmt::Debug;
8
9 #[async_trait::async_trait(?Send)]
10 pub trait ObjectBackend: Sized + Clone + Send {
11 async fn object_operation<O, D>(
12 &self,
13 object: O,
14 operation: &str,
15 payload: D,
16 operation_state: &OperationState,
17 ) -> Result<D::Success, OperationError<D::Failure>>
18 where
19 O: GiteratedObject + Debug + 'static,
20 D: GiteratedOperation<O> + Debug + 'static,
21 D::Success: Clone,
22 D::Failure: Clone;
23
24 async fn get_object<O: GiteratedObject + Debug + 'static>(
25 &self,
26 object_str: &str,
27 operation_state: &OperationState,
28 ) -> Result<Object<O, Self>, OperationError<ObjectRequestError>>;
29 }
30