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

ambee/giterated

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

Fucking whatever there you go

Amber - ⁨2⁩ years ago

parent: tbd commit: ⁨57c2ca5

⁨giterated-plugin/src/callback/mod.rs⁩ - ⁨627⁩ 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::new_stack::{runtime_handler::RuntimeHandle, PluginState, Runtime};
11
12 /// A container for a callback pointer, used to provide an internal callback function or
13 /// state to a plugin when performing a callback.
14 #[derive(Clone, Copy)]
15 #[repr(C)]
16 pub struct CallbackPtr(*const ());
17
18 impl CallbackPtr {
19 pub unsafe fn from_raw(callback: *const ()) -> Self {
20 Self(callback)
21 }
22 }
23
24 #[repr(C)]
25 pub struct RuntimeState {
26 pub runtime: RuntimeHandle,
27 pub operation_state: PluginState,
28 }
29