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

ambee/giterated

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

Huge refactor to prep for moving the daemon over to the plugin architecture

Amber - ⁨2⁩ years ago

parent: tbd commit: ⁨5df753c

⁨giterated-plugins/giterated-plugin/src/new_stack/runtime_handler.rs⁩ - ⁨756⁩ bytes
Raw
1 use giterated_models::error::OperationError;
2
3 use crate::vtable::{AnyFailure, AnySuccess, OperationVTable};
4
5 pub struct RuntimeHandle {
6 inner: RuntimeHandleInner,
7 }
8
9 impl RuntimeHandle {
10 pub async fn handle_serialized(
11 &self,
12 operation_name: &str,
13 object: &str,
14 operation: &[u8],
15 ) -> Result<Vec<u8>, OperationError<Vec<u8>>> {
16 todo!()
17 }
18 }
19
20 #[repr(C)]
21 struct RuntimeHandleInner {
22 handle_serialized: unsafe extern "C" fn(
23 object_kind: &str,
24 operation_name: &str,
25 object: &str,
26 operation_payload: &[u8],
27 ) -> HandlerResult,
28 }
29
30 #[repr(C)]
31 struct HandlerResult {
32 operation_vtable: OperationVTable,
33 result: Result<AnySuccess, OperationError<AnyFailure>>,
34 }
35