diff options
author | hozan23 <hozan23@proton.me> | 2023-12-02 05:10:33 +0300 |
---|---|---|
committer | hozan23 <hozan23@proton.me> | 2023-12-02 05:10:33 +0300 |
commit | 8cdc44b24724acf7dd458e59f5ceed4af04574be (patch) | |
tree | 1e0aad5a905508c54f7d9be4d4b800b7e8f7d532 /jsonrpc/src | |
parent | 5111a3d5749625c3d8e26a24a5a32c4da58f18d3 (diff) |
Ensure uniform usage of the name `karyon` across all files
Diffstat (limited to 'jsonrpc/src')
-rw-r--r-- | jsonrpc/src/client.rs | 4 | ||||
-rw-r--r-- | jsonrpc/src/codec.rs | 4 | ||||
-rw-r--r-- | jsonrpc/src/error.rs | 6 | ||||
-rw-r--r-- | jsonrpc/src/lib.rs | 4 | ||||
-rw-r--r-- | jsonrpc/src/server.rs | 6 | ||||
-rw-r--r-- | jsonrpc/src/service.rs | 6 |
6 files changed, 15 insertions, 15 deletions
diff --git a/jsonrpc/src/client.rs b/jsonrpc/src/client.rs index 69c2e6d..8e413e2 100644 --- a/jsonrpc/src/client.rs +++ b/jsonrpc/src/client.rs @@ -1,8 +1,8 @@ use log::debug; use serde::{de::DeserializeOwned, Serialize}; -use karyons_core::util::random_32; -use karyons_net::ToConn; +use karyon_core::util::random_32; +use karyon_net::ToConn; use crate::{ codec::{Codec, CodecConfig}, diff --git a/jsonrpc/src/codec.rs b/jsonrpc/src/codec.rs index 5dac8da..451cdb4 100644 --- a/jsonrpc/src/codec.rs +++ b/jsonrpc/src/codec.rs @@ -1,7 +1,7 @@ use memchr::memchr; -use karyons_core::async_util::timeout; -use karyons_net::Conn; +use karyon_core::async_util::timeout; +use karyon_net::Conn; use crate::{Error, Result}; diff --git a/jsonrpc/src/error.rs b/jsonrpc/src/error.rs index 5437c6d..8bc8c49 100644 --- a/jsonrpc/src/error.rs +++ b/jsonrpc/src/error.rs @@ -2,7 +2,7 @@ use thiserror::Error as ThisError; pub type Result<T> = std::result::Result<T, Error>; -/// Represents karyons's jsonrpc Error. +/// Represents karyon's jsonrpc Error. #[derive(ThisError, Debug)] pub enum Error { #[error(transparent)] @@ -27,8 +27,8 @@ pub enum Error { InvalidMsg(&'static str), #[error(transparent)] - KaryonsCore(#[from] karyons_core::error::Error), + KaryonCore(#[from] karyon_core::error::Error), #[error(transparent)] - KaryonsNet(#[from] karyons_net::NetError), + KaryonNet(#[from] karyon_net::NetError), } diff --git a/jsonrpc/src/lib.rs b/jsonrpc/src/lib.rs index da9047d..df66363 100644 --- a/jsonrpc/src/lib.rs +++ b/jsonrpc/src/lib.rs @@ -9,7 +9,7 @@ //! use serde_json::Value; //! use smol::net::{TcpStream, TcpListener}; //! -//! use karyons_jsonrpc::{JsonRPCError, Server, Client, register_service, ServerConfig, ClientConfig}; +//! use karyon_jsonrpc::{JsonRPCError, Server, Client, register_service, ServerConfig, ClientConfig}; //! //! struct HelloWorld {} //! @@ -63,7 +63,7 @@ pub use error::Error as JsonRPCError; pub use server::{Server, ServerConfig}; pub use service::{RPCMethod, RPCService}; -pub use karyons_net::Endpoint; +pub use karyon_net::Endpoint; const JSONRPC_VERSION: &str = "2.0"; use error::{Error, Result}; diff --git a/jsonrpc/src/server.rs b/jsonrpc/src/server.rs index 4f1bada..92920ad 100644 --- a/jsonrpc/src/server.rs +++ b/jsonrpc/src/server.rs @@ -3,12 +3,12 @@ use std::{collections::HashMap, sync::Arc}; use log::{debug, error, warn}; use smol::lock::RwLock; -use karyons_core::{ +use karyon_core::{ async_util::{TaskGroup, TaskResult}, Executor, }; -use karyons_net::{Conn, Listener, ToListener}; +use karyon_net::{Conn, Listener, ToListener}; use crate::{ codec::{Codec, CodecConfig}, @@ -44,7 +44,7 @@ impl<'a> Server<'a> { /// Returns the local endpoint. pub fn local_endpoint(&self) -> Result<Endpoint> { - self.listener.local_endpoint().map_err(Error::KaryonsNet) + self.listener.local_endpoint().map_err(Error::KaryonNet) } /// Starts the RPC server diff --git a/jsonrpc/src/service.rs b/jsonrpc/src/service.rs index 62ec726..943442c 100644 --- a/jsonrpc/src/service.rs +++ b/jsonrpc/src/service.rs @@ -20,7 +20,7 @@ pub trait RPCService: Sync + Send { /// ``` /// use serde_json::Value; /// -/// use karyons_jsonrpc::{JsonRPCError, register_service}; +/// use karyon_jsonrpc::{JsonRPCError, register_service}; /// /// struct Hello {} /// @@ -36,11 +36,11 @@ pub trait RPCService: Sync + Send { #[macro_export] macro_rules! register_service { ($t:ty, $($m:ident),*) => { - impl karyons_jsonrpc::RPCService for $t { + impl karyon_jsonrpc::RPCService for $t { fn get_method<'a>( &'a self, name: &'a str - ) -> Option<karyons_jsonrpc::RPCMethod> { + ) -> Option<karyon_jsonrpc::RPCMethod> { match name { $( stringify!($m) => { |