-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
122 additions
and
102 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
pub mod ctrlc; | ||
pub mod landiscovery; | ||
pub mod muxrpc; | ||
pub mod sensor; | ||
pub mod rpcs; | ||
pub mod sensor; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,21 @@ | ||
use async_std::{ | ||
io::{Read, Write}, | ||
}; | ||
use async_std::io::{Read, Write}; | ||
|
||
use kuska_ssb::{ | ||
api::ApiHelper, | ||
rpc::RecvMsg, | ||
}; | ||
use async_trait::async_trait; | ||
use kuska_ssb::{api::ApiHelper, rpc::RecvMsg}; | ||
|
||
use crate::storage::StorageEvent; | ||
use crate::error::AnyResult; | ||
use crate::storage::StorageEvent; | ||
|
||
#[derive(Debug)] | ||
pub enum RpcInput { | ||
None, | ||
Network(i32,RecvMsg), | ||
Storage(StorageEvent) | ||
Network(i32, RecvMsg), | ||
Storage(StorageEvent), | ||
} | ||
|
||
#[async_trait] | ||
pub trait RpcHandler<R: Read + Unpin + Send + Sync, W: Write + Unpin + Send + Sync> : Send + Sync { | ||
pub trait RpcHandler<R: Read + Unpin + Send + Sync, W: Write + Unpin + Send + Sync>: | ||
Send + Sync | ||
{ | ||
async fn handle(&mut self, api: &mut ApiHelper<R, W>, op: &RpcInput) -> AnyResult<bool>; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
mod base; | ||
mod get; | ||
mod history_stream; | ||
mod whoami; | ||
mod base; | ||
|
||
pub use base::{RpcInput,RpcHandler}; | ||
pub use base::{RpcHandler, RpcInput}; | ||
pub use get::GetHandler; | ||
pub use history_stream::HistoryStreamHandler; | ||
pub use whoami::WhoAmIHandler; | ||
pub use whoami::WhoAmIHandler; |
Oops, something went wrong.