use giterated_models::object_backend::ObjectBackend; use giterated_models::{ instance::Instance, object::ObjectRequest, operation::OperationState, user::{DisplayName, User}, }; use giterated_plugin::{callback::RuntimeState, handle::PluginHandle, new_stack::Runtime}; use tracing::{info, Level}; #[tokio::main] async fn main() -> Result<(), anyhow::Error> { tracing_subscriber::fmt() .pretty() .with_thread_names(true) .with_max_level(Level::TRACE) .init(); let handle = PluginHandle::from_dylib("example_plugin_dylib.dll").unwrap(); info!("1"); let mut runtime = Runtime::new(); info!("2"); // runtime.insert_plugin(handle); info!("3"); runtime.init(); info!("4"); let runtime = unsafe { RuntimeState::from_static() }; let _object_request = ObjectRequest(String::from("foobar")); let _state = OperationState::default(); let _instance = runtime .get_object::("giterated.dev", &OperationState::default()) .await?; let mut user = runtime .get_object::("ambee:giterated.dev", &OperationState::default()) .await?; let display_name = user.get::(&OperationState::default()).await?; info!("Display name for user as a value: {}", display_name); let display_name = user .get_setting::(&OperationState::default()) .await?; info!("Display name for user as a setting: {}", display_name); Ok(()) }