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/callback/mod.rs⁩ - ⁨630⁩ bytes
Raw
1 mod operation;
2 use std::sync::Arc;
3
4 pub use operation::*;
5 mod value;
6 pub use value::*;
7 mod setting;
8 pub use setting::*;
9
10 use crate::{
11 new_stack::{PluginState, Runtime},
12 vtable::RuntimeVTable,
13 };
14
15 /// A container for a callback pointer, used to provide an internal callback function or
16 /// state to a plugin when performing a callback.
17 #[derive(Clone, Copy)]
18 #[repr(C)]
19 pub struct CallbackPtr(*const ());
20
21 impl CallbackPtr {
22 pub unsafe fn from_raw(callback: *const ()) -> Self {
23 Self(callback)
24 }
25 }
26
27 #[repr(C)]
28 pub struct RuntimeState {
29 pub vtable: RuntimeVTable,
30 pub operation_state: PluginState,
31 }
32