feat: add native call

This commit is contained in:
Kingtous
2023-04-28 13:46:43 +08:00
parent 3774f8308f
commit c140bcfed6
4 changed files with 159 additions and 30 deletions

View File

@@ -1,28 +1,35 @@
use crate::{call_if_method, define_method_prefix, return_if_not_method};
use super::PluginNativeHandler;
#[derive(Default)]
/// Session related handler for librustdesk core.
pub struct PluginNativeSessionHandler;
impl PluginNativeHandler for PluginNativeSessionHandler {
fn on_message(method: &String, data: &serde_json::Map<String, serde_json::Value>) -> Option<super::NR> {
define_method_prefix!("session_");
fn on_message(
&self,
method: &str,
data: &serde_json::Map<String, serde_json::Value>,
) -> Option<super::NR> {
None
}
fn on_message_raw(method: &String, data: &serde_json::Map<String, serde_json::Value>, raw: *const std::ffi::c_void, raw_len: usize) -> Option<super::NR> {
fn on_message_raw(
&self,
method: &str,
data: &serde_json::Map<String, serde_json::Value>,
raw: *const std::ffi::c_void,
raw_len: usize,
) -> Option<super::NR> {
None
}
}
impl PluginNativeSessionHandler {
fn create_session() {
fn create_session() {}
}
fn add_session_hook() {
}
}
fn add_session_hook() {}
}