use anyhow::Error; use giterated_models::{ error::OperationError, instance::Instance, object::{ObjectRequest, ObjectRequestError, ObjectResponse}, user::{DisplayName, User}, }; use giterated_plugin::{ abi::state::{StateExtractor, StateUUID}, local::PluginStackBuilder, plugin, }; plugin!( name: "Example Plugin", version: "0.0.1", author: "Amber Kowalski", // Experimental syntax for requesting specific plugin features features: ["tracing", "tokio"], description: "An example plugin to demonstrate the development process of Giterated plugins." ); /// Some kind of global state for the plugin struct PluginState; impl StateUUID for PluginState { fn uuid() -> u128 { 214829528589663836760123667646253464473 } } /// The plugin's initialization function. Ran when the plugin is loaded, used to /// build the plugin's stack. #[plugin::init] pub fn init(builder: &mut PluginStackBuilder) -> Result<(), Error> { builder.insert_state(PluginState); builder.object::().object::(); builder.setting_getter(setting_getter); Ok(()) } async fn handler( object: User, operation: ObjectRequest, // state_extractor: StateExtractor, ) -> Result> { todo!() } async fn setting_getter( object: User, // state_extractor: StateExtractor, ) -> Result> { todo!() }