Fucking whatever there you go
parent: tbd commit: 57c2ca5
1 | use OnceLock; |
2 | |
3 | use |
4 | , | OperationError
5 | , | Instance
6 | , | ObjectRequest
7 | , |
8 | ; |
9 | use |
10 | , | PluginInitializationState
11 | , |
12 | , |
13 | ; |
14 | use PluginStackBuilder; |
15 | use ; |
16 | |
17 | static INIT_VTABLE: = new; |
18 | |
19 | |
20 | pub extern "C" |
21 | const PLUGIN_NAME: &str = "Example Plugin"; |
22 | const PLUGIN_VERSION: &str = "1.0.0"; |
23 | |
24 | FFIPluginMeta |
25 | name: PLUGIN_NAME.as_ptr, |
26 | name_len: PLUGIN_NAME.len, |
27 | version: PLUGIN_VERSION.as_ptr, |
28 | version_len: PLUGIN_VERSION.len, |
29 | |
30 | |
31 | |
32 | |
33 | pub extern "C" |
34 | println!; |
35 | |
36 | |
37 | |
38 | pub extern "C" |
39 | INIT_VTABLE.set .unwrap; |
40 | println!; |
41 | |
42 | |
43 | |
44 | pub extern "C" |
45 | fmt |
46 | .pretty |
47 | .with_thread_names |
48 | .with_max_level |
49 | .init; |
50 | |
51 | PluginState |
52 | inner: Box into_raw, |
53 | |
54 | |
55 | |
56 | |
57 | pub extern "C" |
58 | state: *mut PluginInitializationState, |
59 | *mut PluginInitializationState |
60 | let _guard: EnteredSpan = trace_span! .entered; |
61 | let init_vtable = INIT_VTABLE.get .unwrap; |
62 | let mut builder = new; |
63 | |
64 | builder.; | .
65 | builder.operation; |
66 | builder.value; |
67 | // builder.setting_getter(setting_getter); |
68 | |
69 | state |
70 | |
71 | |
72 | async |
73 | state: , |
74 | _object: Instance, |
75 | _operation: ObjectRequest, |
76 | |
77 | info!; |
78 | |
79 | todo! |
80 | |
81 | |
82 | async |
83 | state: , |
84 | object: User, |
85 | |
86 | info!; |
87 | |
88 | Ok |
89 | |
90 | |
91 | // fn setting_getter(state: (), object: User) -> Result<DisplayName, ()> { |
92 | // info!("OwO, setting gotten!"); |
93 | |
94 | // Ok(DisplayName(String::from("heya! (but from a setting)"))) |
95 | // } |
96 |