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

ambee/giterated

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

Fixes

Amber - ⁨2⁩ years ago

parent: tbd commit: ⁨b87f0a3

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