diff --git a/Cargo.lock b/Cargo.lock index 18fdf9c..95b93c4 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -788,6 +788,7 @@ dependencies = [ "dlopen2", "giterated-models", "semver", + "serde", "serde_json", "thiserror", "tracing", diff --git a/giterated-daemon/src/client.rs b/giterated-daemon/src/client.rs index cba648d..801bf9c 100644 --- a/giterated-daemon/src/client.rs +++ b/giterated-daemon/src/client.rs @@ -6,18 +6,18 @@ use giterated_models::{ instance::Instance, object_backend::ObjectBackend, }; -use giterated_plugin::new_stack::{runtime_handler::RuntimeHandle, Runtime}; +use giterated_plugin::new_stack::{handle::RuntimeHandle, OperationState, Runtime}; use giterated_protocol::{ handlers::{NetworkedObject, NetworkedOperation}, - AuthenticatedPayload, StackOperationState, + AuthenticatedPayload, }; use tokio::net::TcpStream; use tokio_tungstenite::{tungstenite::Message, WebSocketStream}; pub async fn client_wrapper( - our_instance: Instance, + _our_instance: Instance, mut socket: WebSocketStream, - runtime: Arc, + _runtime: Arc, ) { loop { let message = socket.next().await; @@ -97,7 +97,7 @@ pub async fn client_wrapper( pub async fn handle_client_message( payload: AuthenticatedPayload, - operation_state: StackOperationState, + operation_state: OperationState, runtime: RuntimeHandle, ) -> Result, OperationError>> { let mut networked_object = runtime diff --git a/giterated-daemon/src/main.rs b/giterated-daemon/src/main.rs index 83c897b..d9b698b 100644 --- a/giterated-daemon/src/main.rs +++ b/giterated-daemon/src/main.rs @@ -49,7 +49,7 @@ async fn main() -> Result<(), Error> { info!("Connected"); - let mut runtime = Runtime::default(); + let mut runtime = Runtime::new(); let runtime = Arc::new(runtime); diff --git a/giterated-plugin/Cargo.toml b/giterated-plugin/Cargo.toml index 709db83..ba50aed 100644 --- a/giterated-plugin/Cargo.toml +++ b/giterated-plugin/Cargo.toml @@ -14,3 +14,4 @@ giterated-models = { path = "../giterated-models" } semver = "*" serde_json = "1.0" async-trait = "0.1" +serde = "*" \ No newline at end of file diff --git a/giterated-plugin/giterated-plugin-sys/src/lib.rs b/giterated-plugin/giterated-plugin-sys/src/lib.rs index d077640..4dd8292 100644 --- a/giterated-plugin/giterated-plugin-sys/src/lib.rs +++ b/giterated-plugin/giterated-plugin-sys/src/lib.rs @@ -1,4 +1,6 @@ -use std::sync::OnceLock; +mod local_runtime; + +use std::marker::PhantomData; use giterated_models::{ object::GiteratedObject, operation::GiteratedOperation, settings::Setting, @@ -7,8 +9,7 @@ use giterated_models::{ use giterated_plugin::{ callback::{ CallbackPtr, IntoPluginOperationHandler, IntoPluginSettingGetter, IntoPluginSettingSetter, - IntoPluginValueGetter, OperationHandlerCallback, SettingGetterCallback, - ValueGetterCallback, + IntoPluginValueGetter, OperationHandlerCallback, ValueGetterCallback, }, handle::PluginInitializationState, new_stack::PluginState, @@ -31,8 +32,8 @@ impl<'init, S> PluginStackBuilder<'init, S> { plugin_state: S, state: *mut PluginInitializationState, vtable: &'init InitializationVTable, - ) -> Self { - Self { + ) -> PluginStackBuilder<'init, S> { + PluginStackBuilder { init_state: state, vtable, state: plugin_state, @@ -68,7 +69,7 @@ impl<'init, S> PluginStackBuilder<'init, S> { self } - pub fn object_setting(&mut self, get: HG, set: HS) -> &mut Self + pub fn object_setting(&mut self, _get: HG, _set: HS) -> &mut Self where O: GiteratedObject, OS: IntoSettingVTable + Setting, @@ -138,12 +139,10 @@ impl<'init, S> PluginStackBuilder<'init, S> { } pub fn operation< - DS, - DF, A, O: GiteratedObject + IntoObjectVTable, D: IntoOperationVTable + GiteratedOperation, - T: IntoPluginOperationHandler, + T: IntoPluginOperationHandler, >( &mut self, handler: T, @@ -155,7 +154,7 @@ impl<'init, S> PluginStackBuilder<'init, S> { self.init_state, O::object_name(), D::operation_name(), - OperationHandlerCallback::new::(handler), + OperationHandlerCallback::new::(handler), ) } @@ -225,7 +224,7 @@ pub trait ValueSettingExt { } impl ValueSettingExt for PluginStackBuilder<'_, PS> { - fn value_setting(&mut self, get: HG, set: HS) -> &mut Self + fn value_setting(&mut self, _get: HG, _set: HS) -> &mut Self where O: GiteratedObject + IntoObjectVTable + 'static, VS: GiteratedObjectValue + IntoValueVTable + Setting + IntoSettingVTable, diff --git a/giterated-plugin/giterated-plugin-sys/src/local_runtime.rs b/giterated-plugin/giterated-plugin-sys/src/local_runtime.rs new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/giterated-plugin/giterated-plugin-sys/src/local_runtime.rs @@ -0,0 +1 @@ + diff --git a/giterated-plugin/src/callback/mod.rs b/giterated-plugin/src/callback/mod.rs index 8ce311a..38225a3 100644 --- a/giterated-plugin/src/callback/mod.rs +++ b/giterated-plugin/src/callback/mod.rs @@ -7,7 +7,10 @@ pub use value::*; mod setting; pub use setting::*; -use crate::new_stack::{runtime_handler::RuntimeHandle, PluginState, Runtime}; +use crate::{ + new_stack::{PluginState, Runtime}, + vtable::RuntimeVTable, +}; /// A container for a callback pointer, used to provide an internal callback function or /// state to a plugin when performing a callback. @@ -23,6 +26,6 @@ impl CallbackPtr { #[repr(C)] pub struct RuntimeState { - pub runtime: RuntimeHandle, + pub vtable: RuntimeVTable, pub operation_state: PluginState, } diff --git a/giterated-plugin/src/callback/operation.rs b/giterated-plugin/src/callback/operation.rs index db34f8a..62606ed 100644 --- a/giterated-plugin/src/callback/operation.rs +++ b/giterated-plugin/src/callback/operation.rs @@ -1,7 +1,10 @@ -use giterated_models::error::OperationError; +use giterated_models::{ + error::OperationError, object::GiteratedObject, operation::GiteratedOperation, + value::GiteratedObjectValue, +}; use crate::{ - new_stack::{runtime_handler::RuntimeHandle, PluginState, Runtime, State}, + new_stack::{handle::RuntimeHandle, OperationState, PluginState, Runtime, State}, AnyObject, AnyOperation, }; @@ -22,7 +25,13 @@ pub struct OperationHandlerCallback { } impl OperationHandlerCallback { - pub fn new>( + pub fn new< + S, + O: GiteratedObject, + D: GiteratedOperation, + A, + T: IntoPluginOperationHandler, + >( handler: T, ) -> Self { OperationHandlerCallback { @@ -32,7 +41,7 @@ impl OperationHandlerCallback { } } -pub trait IntoPluginOperationHandler { +pub trait IntoPluginOperationHandler, A> { unsafe extern "C" fn handle( callback_ptr: CallbackPtr, runtime_state: &RuntimeState, @@ -43,13 +52,13 @@ pub trait IntoPluginOperationHandler { fn callback_ptr(&self) -> CallbackPtr; } -impl IntoPluginOperationHandler for F +impl IntoPluginOperationHandler for F where - Fut: Future>>, + Fut: Future>>, F: Fn(S, O, D) -> Fut, S: Clone + Debug, - O: Debug, - D: Debug, + O: Debug + GiteratedObject, + D: Debug + GiteratedOperation, { unsafe extern "C" fn handle( callback: CallbackPtr, @@ -84,13 +93,13 @@ where } } -impl IntoPluginOperationHandler for F +impl IntoPluginOperationHandler for F where - Fut: Future>>, + Fut: Future>>, F: Fn(S, O, D, A1) -> Fut, S: Clone + Debug, - O: Debug, - D: Debug, + O: Debug + GiteratedObject, + D: Debug + GiteratedOperation, { unsafe extern "C" fn handle( callback_ptr: CallbackPtr, @@ -107,13 +116,13 @@ where } } -impl IntoPluginOperationHandler for F +impl IntoPluginOperationHandler for F where - Fut: Future>>, + Fut: Future>>, F: Fn(S, O, D, A1, A2) -> Fut, S: Clone + Debug, - O: Debug, - D: Debug, + O: Debug + GiteratedObject, + D: Debug + GiteratedOperation, { unsafe extern "C" fn handle( callback_ptr: CallbackPtr, @@ -130,43 +139,43 @@ where } } -pub trait FromOperationState: Sized { +pub trait FromOperationState: Sized { fn from_operation_state( - state: &S, + operation_state: &OperationState, runtime_state: &RuntimeState, object: &O, operation: &D, ) -> Result>; } -impl FromOperationState for RuntimeHandle { +impl FromOperationState for RuntimeHandle { fn from_operation_state( - state: &S, + operation_state: &OperationState, runtime_state: &RuntimeState, object: &O, operation: &D, ) -> Result> { - Ok(runtime_state.runtime.clone()) + Ok(unsafe { RuntimeHandle::from_vtable(runtime_state.vtable) }) } } -impl FromOperationState for Option +impl FromOperationState for Option where - T: FromOperationState, + T: FromOperationState, { fn from_operation_state( - state: &S, + operation_state: &OperationState, runtime_state: &RuntimeState, object: &O, operation: &D, ) -> Result> { - Ok(T::from_operation_state(state, runtime_state, object, operation).ok()) + Ok(T::from_operation_state(operation_state, runtime_state, object, operation).ok()) } } -impl FromOperationState for State { +impl FromOperationState for State { fn from_operation_state( - state: &S, + operation_state: &OperationState, runtime_state: &RuntimeState, object: &O, operation: &D, diff --git a/giterated-plugin/src/new_stack/handle.rs b/giterated-plugin/src/new_stack/handle.rs new file mode 100644 index 0000000..65f3bbd --- /dev/null +++ b/giterated-plugin/src/new_stack/handle.rs @@ -0,0 +1,62 @@ +use std::marker::PhantomData; + +use giterated_models::{ + error::OperationError, + object::{GiteratedObject, Object, ObjectRequestError}, + object_backend::ObjectBackend, + operation::GiteratedOperation, +}; +use std::fmt::Debug; + +use crate::vtable::RuntimeVTable; + +use super::OperationState; + +#[derive(Clone)] +pub struct RuntimeHandle { + runtime_vtable: RuntimeVTable, +} + +impl RuntimeHandle { + pub async fn handle_serialized( + &self, + object: &str, + operation_name: &str, + payload: &[u8], + ) -> Result, OperationError>> { + todo!() + } +} + +impl RuntimeHandle { + pub(crate) unsafe fn from_vtable(runtime_vtable: RuntimeVTable) -> Self { + Self { runtime_vtable } + } +} + +#[async_trait::async_trait(?Send)] +impl ObjectBackend for RuntimeHandle { + async fn object_operation( + &self, + object: O, + operation: &str, + payload: D, + operation_state: &OperationState, + ) -> Result> + where + O: GiteratedObject + Debug + 'static, + D: GiteratedOperation + Debug + 'static, + D::Success: Clone, + D::Failure: Clone, + { + todo!() + } + + async fn get_object( + &self, + object_str: &str, + operation_state: &OperationState, + ) -> Result, OperationError> { + todo!() + } +} diff --git a/giterated-plugin/src/new_stack/mod.rs b/giterated-plugin/src/new_stack/mod.rs index 26b8d98..5ab4969 100644 --- a/giterated-plugin/src/new_stack/mod.rs +++ b/giterated-plugin/src/new_stack/mod.rs @@ -1,3 +1,4 @@ +pub mod handle; pub mod operation_walker; pub mod runtime_handler; @@ -11,6 +12,7 @@ use giterated_models::{ operation::GiteratedOperation, }; use semver::Version; +use serde::Serialize; use tracing::{debug, debug_span, field::DebugValue, span, trace, trace_span, warn, Level}; use crate::{ @@ -34,10 +36,6 @@ impl std::ops::Deref for State { } } -pub struct OperationState { - pub our_instance: Instance, -} - #[derive(Default)] pub struct TypeMetadata { pub objects: HashMap<&'static str, ObjectVtable>, @@ -178,18 +176,16 @@ impl PluginState { } } -pub struct Runtime { +pub struct Runtime { plugins: Vec<(PluginMeta, PluginHandle)>, handlers: RuntimeHandlers, - _marker: PhantomData, } -impl Runtime { +impl Runtime { pub fn new() -> Self { Self { plugins: vec![], handlers: RuntimeHandlers::default(), - _marker: PhantomData, } } @@ -490,3 +486,31 @@ pub enum HandlerError { Internal(()), Unhandled, } + +pub trait StateId { + fn state_id(&self) -> &'static str; +} + +pub unsafe trait FfiState: StateId { + fn into_ffi_state_bytes(self) -> Vec; + + fn from_ffi_state_bytes(bytes: Vec) -> Self; +} + +unsafe impl FfiState for T +where + T: Serialize + StateId, +{ + fn into_ffi_state_bytes(self) -> Vec { + todo!() + } + + fn from_ffi_state_bytes(bytes: Vec) -> Self { + todo!() + } +} + +#[derive(Clone, Debug)] +pub struct OperationState { + entries: HashMap<&'static str, Vec>, +} diff --git a/giterated-plugin/src/new_stack/runtime_handler.rs b/giterated-plugin/src/new_stack/runtime_handler.rs index 178bff6..56ae989 100644 --- a/giterated-plugin/src/new_stack/runtime_handler.rs +++ b/giterated-plugin/src/new_stack/runtime_handler.rs @@ -10,23 +10,7 @@ use giterated_models::{ use crate::vtable::{AnyFailure, AnySuccess, OperationVTable}; -use super::PluginState; - -#[derive(Clone)] -pub struct RuntimeHandle { - inner: Arc, -} - -impl RuntimeHandle { - pub async fn handle_serialized( - &self, - operation_name: &str, - object: &str, - operation: &[u8], - ) -> Result, OperationError>> { - todo!() - } -} +use super::{handle::RuntimeHandle, PluginState}; #[repr(C)] struct RuntimeHandleInner { @@ -47,30 +31,3 @@ struct HandlerResult { operation_vtable: OperationVTable, result: Result>, } - -#[async_trait::async_trait(?Send)] -impl ObjectBackend for RuntimeHandle { - async fn object_operation( - &self, - object: O, - operation: &str, - payload: D, - operation_state: &S, - ) -> Result> - where - O: GiteratedObject + Debug + 'static, - D: GiteratedOperation + Debug + 'static, - D::Success: Clone, - D::Failure: Clone, - { - todo!() - } - - async fn get_object( - &self, - object_str: &str, - operation_state: &S, - ) -> Result, OperationError> { - todo!() - } -} diff --git a/giterated-plugin/src/vtable/mod.rs b/giterated-plugin/src/vtable/mod.rs index 543839a..32e36d0 100644 --- a/giterated-plugin/src/vtable/mod.rs +++ b/giterated-plugin/src/vtable/mod.rs @@ -1,7 +1,9 @@ //! Giterated's VTable System //! //! Docs here? :) +mod runtime; mod setting; +pub use runtime::*; pub use setting::*; mod operation; pub use operation::*; diff --git a/giterated-plugin/src/vtable/runtime.rs b/giterated-plugin/src/vtable/runtime.rs new file mode 100644 index 0000000..3f37686 --- /dev/null +++ b/giterated-plugin/src/vtable/runtime.rs @@ -0,0 +1,2 @@ +#[derive(Clone, Copy)] +pub struct RuntimeVTable {} diff --git a/plugins/example-plugin/src/lib.rs b/plugins/example-plugin/src/lib.rs index 3125afc..4b580e3 100644 --- a/plugins/example-plugin/src/lib.rs +++ b/plugins/example-plugin/src/lib.rs @@ -3,7 +3,7 @@ use std::sync::OnceLock; use giterated_models::{ error::OperationError, instance::Instance, - object::ObjectRequest, + object::{ObjectRequest, ObjectRequestError, ObjectResponse}, user::{DisplayName, User}, }; use giterated_plugin::{ @@ -73,7 +73,7 @@ async fn handler( state: (), _object: Instance, _operation: ObjectRequest, -) -> Result<(), OperationError<()>> { +) -> Result> { info!("handling operation!"); todo!() diff --git a/plugins/example-plugin/src/main.rs b/plugins/example-plugin/src/main.rs index 3e91522..e5a42b2 100644 --- a/plugins/example-plugin/src/main.rs +++ b/plugins/example-plugin/src/main.rs @@ -18,7 +18,7 @@ fn main() { let mut handle = PluginHandle::from_dylib("example_plugin_dylib.dll").unwrap(); - let mut runtime = Runtime::<()>::new(); + let mut runtime = Runtime::new(); runtime.insert_plugin(handle); diff --git a/plugins/giterated-backend/src/handlers.rs b/plugins/giterated-backend/src/handlers.rs index a6a6118..8447c51 100644 --- a/plugins/giterated-backend/src/handlers.rs +++ b/plugins/giterated-backend/src/handlers.rs @@ -5,7 +5,7 @@ use giterated_models::{ repository::{Repository, RepositoryInfoRequest, RepositorySummary, RepositoryView}, user::{User, UserRepositoriesRequest}, }; -use giterated_plugin::new_stack::{runtime_handler::RuntimeHandle, OperationState, Runtime, State}; +use giterated_plugin::new_stack::{handle::RuntimeHandle, OperationState, Runtime, State}; use crate::DatabaseBackend; diff --git a/plugins/giterated-issues/src/handlers.rs b/plugins/giterated-issues/src/handlers.rs index 4463009..ca143d3 100644 --- a/plugins/giterated-issues/src/handlers.rs +++ b/plugins/giterated-issues/src/handlers.rs @@ -1,4 +1,3 @@ -use crate::db::IssueRow; use crate::setting::Contents; use crate::value::{Author, CommentCount, CreationDate, Name}; use crate::IssuesPluginState; @@ -9,110 +8,110 @@ use crate::{ }, Issue, }; -use giterated_models::error::IntoInternalError; -use giterated_models::user::User; + use giterated_models::{error::OperationError, repository::Repository}; -use sqlx::PgPool; pub async fn create_issue_request( - state: IssuesPluginState, + _state: IssuesPluginState, repository: Repository, - request: CreateIssueRequest, + _request: CreateIssueRequest, ) -> Result> { - // TODO: AUTHN & AUTHZ - let issue = sqlx::query_as!( - IssueRow, - r#"INSERT INTO issues VALUES (null, $1, $2, $3, $4, $5) RETURNING *"#, - repository.to_string(), - request.author.to_string(), - 0, - request.name, - request.contents, - ) - .fetch_one(&state.pool) - .await - .as_internal_error_with_context("creating issue in db")?; + // // TODO: AUTHN & AUTHZ + // let issue = sqlx::query_as!( + // IssueRow, + // r#"INSERT INTO issues VALUES (null, $1, $2, $3, $4, $5) RETURNING *"#, + // repository.to_string(), + // request.author.to_string(), + // 0, + // request.name, + // request.contents, + // ) + // .fetch_one(&state.pool) + // .await + // .as_internal_error_with_context("creating issue in db")?; - Ok(Issue { - repository, - id: issue.id as u32, - }) + // Ok(Issue { + // repository, + // id: issue.id as u32, + // }) + + Ok(Issue { repository, id: 1 }) } pub async fn query_issues_request( - state: IssuesPluginState, - repository: Repository, - request: QueryIssuesRequest, + _state: IssuesPluginState, + _repository: Repository, + _request: QueryIssuesRequest, ) -> Result, OperationError> { // TODO: AUTHN & AUTHZ todo!() } pub async fn edit_issue_request( - state: IssuesPluginState, - issue: Issue, - request: IssueEditRequest, + _state: IssuesPluginState, + _issue: Issue, + _request: IssueEditRequest, ) -> Result<(), OperationError> { // TODO: AUTHN & AUTHZ todo!() } pub async fn issue_post_comment_request( - state: IssuesPluginState, - issue: Issue, - request: IssuePostCommentRequest, + _state: IssuesPluginState, + _issue: Issue, + _request: IssuePostCommentRequest, ) -> Result> { // TODO: AUTHN & AUTHZ todo!() } pub async fn issue_value_author( - state: IssuesPluginState, - issue: Issue, + _state: IssuesPluginState, + _issue: Issue, ) -> Result> { todo!() } pub async fn issue_value_creation_date( - state: IssuesPluginState, - issue: Issue, + _state: IssuesPluginState, + _issue: Issue, ) -> Result> { todo!() } pub async fn issue_value_comment_count( - state: IssuesPluginState, - issue: Issue, + _state: IssuesPluginState, + _issue: Issue, ) -> Result> { todo!() } pub async fn issue_set_setting_name( - state: IssuesPluginState, - issue: Issue, - name: Name, + _state: IssuesPluginState, + _issue: Issue, + _name: Name, ) -> Result<(), OperationError> { todo!() } pub async fn issue_get_setting_name( - state: IssuesPluginState, - issue: Issue, + _state: IssuesPluginState, + _issue: Issue, ) -> Result> { todo!() } pub async fn issue_set_setting_contents( - state: IssuesPluginState, - issue: Issue, - contents: Contents, + _state: IssuesPluginState, + _issue: Issue, + _contents: Contents, ) -> Result<(), OperationError> { todo!() } pub async fn issue_get_setting_contents( - state: IssuesPluginState, - issue: Issue, + _state: IssuesPluginState, + _issue: Issue, ) -> Result> { todo!() } diff --git a/plugins/giterated-issues/src/lib.rs b/plugins/giterated-issues/src/lib.rs index 9e84f14..8423fc3 100644 --- a/plugins/giterated-issues/src/lib.rs +++ b/plugins/giterated-issues/src/lib.rs @@ -1,14 +1,10 @@ -use std::{ - fmt::Display, - str::FromStr, - sync::{Arc, OnceLock}, -}; +use std::{fmt::Display, str::FromStr, sync::OnceLock}; use anyhow::Error; use giterated_models::{object::GiteratedObject, repository::Repository}; use giterated_plugin::{ handle::PluginInitializationState, - new_stack::{FFIPluginMeta, PluginState}, + new_stack::{FFIPluginMeta, OperationState, PluginState}, vtable::{HostVTable, InitializationVTable}, }; use giterated_plugin_sys::PluginStackBuilder; @@ -18,18 +14,11 @@ use handlers::{ issue_value_author, issue_value_comment_count, issue_value_creation_date, query_issues_request, }; use serde::{Deserialize, Serialize}; -use setting::{Contents, NotificationsOverride}; +use setting::NotificationsOverride; use sqlx::{postgres::PgConnectOptions, PgPool}; -use tokio::{ - fs::File, - io::AsyncReadExt, - runtime::Runtime, - spawn, - task::{block_in_place, spawn_blocking}, -}; +use tokio::{fs::File, io::AsyncReadExt, runtime::Runtime}; use toml::Table; use tracing::{debug, info}; -use value::{Author, CommentCount, CreationDate, Name}; pub mod db; pub mod handlers; diff --git a/plugins/giterated-issues/src/main.rs b/plugins/giterated-issues/src/main.rs index 51c98db..2049821 100644 --- a/plugins/giterated-issues/src/main.rs +++ b/plugins/giterated-issues/src/main.rs @@ -21,7 +21,7 @@ pub async fn main() { let mut handle = PluginHandle::from_dylib("giterated_issues.dll").unwrap(); - let mut runtime = Runtime::<()>::new(); + let mut runtime = Runtime::new(); runtime.insert_plugin(handle); diff --git a/plugins/giterated-protocol/src/handlers.rs b/plugins/giterated-protocol/src/handlers.rs index 02178ee..24ce9b9 100644 --- a/plugins/giterated-protocol/src/handlers.rs +++ b/plugins/giterated-protocol/src/handlers.rs @@ -1,4 +1,4 @@ -use std::{fmt::Display, net::SocketAddr, str::FromStr, sync::Arc}; +use std::{fmt::Display, net::SocketAddr, str::FromStr}; use anyhow::Error; use futures_util::{SinkExt, StreamExt}; @@ -9,7 +9,7 @@ use giterated_models::{ operation::GiteratedOperation, }; use giterated_plugin::{ - new_stack::{runtime_handler::RuntimeHandle, Runtime}, + new_stack::{handle::RuntimeHandle, OperationState}, AnyFailure, AnyObject, AnyOperation, AnySuccess, }; use serde::{Deserialize, Serialize}; @@ -19,7 +19,7 @@ use tokio_tungstenite::{connect_async, tungstenite::Message, MaybeTlsStream, Web use crate::{Authenticated, GiteratedMessage, ProtocolState, RemoteError}; pub async fn handle_network_operation( - state: ProtocolState, + _state: ProtocolState, object: NetworkedObject, operation: NetworkedOperation, runtime: RuntimeHandle, @@ -86,10 +86,11 @@ impl GiteratedOperation for NetworkedOperation { /// Handler which will attempt to resolve any operation that doesn't resolve locally /// against a remote instance. -pub async fn try_handle_with_remote( +pub async fn try_handle_with_remote( state: ProtocolState, object: AnyObject, operation: AnyOperation, + _runtime: RuntimeHandle, ) -> Result> { // if object.is::() { // return Err(OperationError::Unhandled);