aboutsummaryrefslogtreecommitdiff
path: root/jsonrpc
diff options
context:
space:
mode:
Diffstat (limited to 'jsonrpc')
-rw-r--r--jsonrpc/Cargo.toml41
-rw-r--r--jsonrpc/impl/Cargo.toml8
-rw-r--r--jsonrpc/impl/src/lib.rs12
-rw-r--r--jsonrpc/src/server/pubsub_service.rs2
-rw-r--r--jsonrpc/src/server/service.rs2
5 files changed, 32 insertions, 33 deletions
diff --git a/jsonrpc/Cargo.toml b/jsonrpc/Cargo.toml
index 2260b7e..bdbcb74 100644
--- a/jsonrpc/Cargo.toml
+++ b/jsonrpc/Cargo.toml
@@ -17,39 +17,38 @@ tls = ["tcp", "karyon_net/tls"]
ws = ["tcp", "karyon_net/ws", "async-tungstenite"]
unix = ["karyon_net/unix"]
smol = [
- "karyon_core/smol",
- "karyon_net/smol",
- "karyon_jsonrpc_macro/smol",
- "async-tungstenite?/async-std-runtime",
+ "karyon_core/smol",
+ "karyon_net/smol",
+ "karyon_jsonrpc_macro/smol",
+ "async-tungstenite?/async-std-runtime",
]
tokio = [
- "karyon_core/tokio",
- "karyon_net/tokio",
- "karyon_jsonrpc_macro/tokio",
- "async-tungstenite?/tokio-runtime",
+ "karyon_core/tokio",
+ "karyon_net/tokio",
+ "karyon_jsonrpc_macro/tokio",
+ "async-tungstenite?/tokio-runtime",
]
[dependencies]
-karyon_core = { version = "0.1.6", path = "../core", default-features = false }
-karyon_net = { version = "0.1.6", path = "../net", default-features = false }
+karyon_core = { workspace = true }
+karyon_net = { workspace = true }
+karyon_jsonrpc_macro = { workspace = true }
-karyon_jsonrpc_macro = { version = "0.1.6", path = "impl", default-features = false }
-
-log = "0.4.21"
-rand = "0.8.5"
-thiserror = "1.0.61"
+log = { workspace = true }
+rand = { workspace = true }
+thiserror = { workspace = true }
# encode/decode
-serde = { version = "1.0.203", features = ["derive"] }
-serde_json = "1.0.117"
+serde = { workspace = true, features = ["derive"] }
+serde_json = { workspace = true }
# async
-async-trait = "0.1.80"
-async-channel = "2.3.1"
+async-trait = { workspace = true }
+async-channel = { workspace = true }
# websocket
-async-tungstenite = { version = "0.26.2", default-features = false, optional = true }
+async-tungstenite = { workspace = true, optional = true }
[dev-dependencies]
+smol = { workspace = true }
env_logger = "0.11.3"
-smol = "2.0.0"
diff --git a/jsonrpc/impl/Cargo.toml b/jsonrpc/impl/Cargo.toml
index cf001e1..0bf7890 100644
--- a/jsonrpc/impl/Cargo.toml
+++ b/jsonrpc/impl/Cargo.toml
@@ -19,8 +19,8 @@ smol = []
tokio = []
[dependencies]
-proc-macro2 = "1.0"
-quote = "1.0"
-syn = { version = "2.0", features = ["full"] }
+proc-macro2 = { workspace = true }
+quote = { workspace = true }
+syn = { workspace = true, features = ["full"] }
-serde_json = "1.0.117"
+serde_json = { workspace = true }
diff --git a/jsonrpc/impl/src/lib.rs b/jsonrpc/impl/src/lib.rs
index 8814e61..d7ea466 100644
--- a/jsonrpc/impl/src/lib.rs
+++ b/jsonrpc/impl/src/lib.rs
@@ -54,9 +54,9 @@ pub fn rpc_impl(_attr: TokenStream, item: TokenStream) -> TokenStream {
let item: TokenStream2 = item.into();
quote! {
impl karyon_jsonrpc::RPCService for #self_ty {
- fn get_method<'a>(
- &'a self,
- name: &'a str
+ fn get_method(
+ &self,
+ name: &str
) -> Option<karyon_jsonrpc::RPCMethod> {
match name {
#(#impl_methods)*
@@ -115,9 +115,9 @@ pub fn rpc_pubsub_impl(_attr: TokenStream, item: TokenStream) -> TokenStream {
let item: TokenStream2 = item.into();
quote! {
impl karyon_jsonrpc::PubSubRPCService for #self_ty {
- fn get_pubsub_method<'a>(
- &'a self,
- name: &'a str
+ fn get_pubsub_method(
+ &self,
+ name: &str
) -> Option<karyon_jsonrpc::PubSubRPCMethod> {
match name {
#(#impl_methods)*
diff --git a/jsonrpc/src/server/pubsub_service.rs b/jsonrpc/src/server/pubsub_service.rs
index 909b0b0..0775880 100644
--- a/jsonrpc/src/server/pubsub_service.rs
+++ b/jsonrpc/src/server/pubsub_service.rs
@@ -12,6 +12,6 @@ type PubSubRPCMethodOutput<'a> =
/// Defines the interface for an RPC service.
pub trait PubSubRPCService: Sync + Send {
- fn get_pubsub_method<'a>(&'a self, name: &'a str) -> Option<PubSubRPCMethod>;
+ fn get_pubsub_method(&self, name: &str) -> Option<PubSubRPCMethod>;
fn name(&self) -> String;
}
diff --git a/jsonrpc/src/server/service.rs b/jsonrpc/src/server/service.rs
index 787da86..5195d2c 100644
--- a/jsonrpc/src/server/service.rs
+++ b/jsonrpc/src/server/service.rs
@@ -9,6 +9,6 @@ type RPCMethodOutput<'a> =
/// Defines the interface for an RPC service.
pub trait RPCService: Sync + Send {
- fn get_method<'a>(&'a self, name: &'a str) -> Option<RPCMethod>;
+ fn get_method(&self, name: &str) -> Option<RPCMethod>;
fn name(&self) -> String;
}