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-plugin/src/new_stack/runtime_handler.rs⁩ - ⁨604⁩ bytes
Raw
1 use giterated_models::error::OperationError;
2
3 use crate::vtable::{AnyFailure, AnySuccess, OperationVTable};
4
5 use super::PluginState;
6
7 #[repr(C)]
8 struct RuntimeHandleInner {
9 state: PluginState,
10 handle_serialized: unsafe extern "C" fn(
11 object_kind: &str,
12 operation_name: &str,
13 object: &str,
14 operation_payload: &[u8],
15 ) -> HandlerResult,
16 }
17
18 unsafe impl Send for RuntimeHandleInner {}
19 unsafe impl Sync for RuntimeHandleInner {}
20
21 #[repr(C)]
22 struct HandlerResult {
23 operation_vtable: OperationVTable,
24 result: Result<AnySuccess, OperationError<AnyFailure>>,
25 }
26