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

ambee/giterated

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

`[feature/plugins]` Some plugin work?

Amber - ⁨1⁩ year ago

parent: tbd commit: ⁨10a447b

⁨giterated-plugin/src/new_stack/runtime_handler.rs⁩ - ⁨809⁩ bytes
Raw
1 use std::fmt::Debug;
2 use std::sync::Arc;
3
4 use giterated_models::{
5 error::OperationError,
6 object::{GiteratedObject, Object, ObjectRequestError},
7 object_backend::ObjectBackend,
8 operation::GiteratedOperation,
9 };
10
11 use crate::vtable::{AnyFailure, AnySuccess, OperationVTable};
12
13 use super::{handle::RuntimeHandle, PluginState};
14
15 #[repr(C)]
16 struct RuntimeHandleInner {
17 state: PluginState,
18 handle_serialized: unsafe extern "C" fn(
19 object_kind: &str,
20 operation_name: &str,
21 object: &str,
22 operation_payload: &[u8],
23 ) -> HandlerResult,
24 }
25
26 unsafe impl Send for RuntimeHandleInner {}
27 unsafe impl Sync for RuntimeHandleInner {}
28
29 #[repr(C)]
30 struct HandlerResult {
31 operation_vtable: OperationVTable,
32 result: Result<AnySuccess, OperationError<AnyFailure>>,
33 }
34