Radish alpha
h
Radicle Heartwood Protocol & Stack
Radicle
Git (anonymous pull)
Log in to clone via SSH
protocol/service: introduce Result synonym
Fintan Halpenny committed 2 months ago
commit 5111010c96afe9ee9df99a38e2e375f299f12a65
parent 8d34bc76428944b9c2f1bdc0b7abd84609b7d295
1 file changed +7 -2
modified crates/radicle-protocol/src/service/command.rs
@@ -13,7 +13,12 @@ use thiserror::Error;
use super::ServiceState;

/// Function used to query internal service state.
-
pub type QueryState = dyn Fn(&dyn ServiceState) -> Result<(), Error> + Send + Sync;
+
pub type QueryState = dyn Fn(&dyn ServiceState) -> Result<()> + Send + Sync;
+

+
/// A result returned from processing a [`Command`].
+
///
+
/// It is a type synonym for a [`std::result::Result`]
+
pub type Result<T> = std::result::Result<T, Error>;

/// Commands sent to the service by the operator.
pub enum Command {
@@ -45,7 +50,7 @@ pub enum Command {
    /// Unfollow the given node.
    Unfollow(NodeId, Sender<bool>),
    /// Query the internal service state.
-
    QueryState(Arc<QueryState>, Sender<Result<(), Error>>),
+
    QueryState(Arc<QueryState>, Sender<Result<()>>),
}

impl fmt::Debug for Command {