ajj 0.3.3

Simple, modern, ergonomic JSON-RPC 2.0 router built with tower and axum
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use std::borrow::Cow;

/// Errors that can occur when registering a method.
#[derive(Debug, Clone, thiserror::Error)]
pub enum RegistrationError {
    /// Method name is already in use.
    #[error("Method already registered: {0}")]
    MethodAlreadyRegistered(Cow<'static, str>),
}

impl RegistrationError {
    /// Create a new `MethodAlreadyRegistered` error.
    pub fn method_already_registered(name: impl Into<Cow<'static, str>>) -> Self {
        Self::MethodAlreadyRegistered(name.into())
    }
}