pub struct GuidedError;Expand description
Builder for creating guided JSON-RPC errors
Implementations§
Source§impl GuidedError
impl GuidedError
Sourcepub fn parse_error(message: &str) -> ErrorObject<'static>
pub fn parse_error(message: &str) -> ErrorObject<'static>
Parse error - client sent non-JSON-RPC content
Sourcepub fn invalid_request(message: &str) -> ErrorObject<'static>
pub fn invalid_request(message: &str) -> ErrorObject<'static>
Invalid request - malformed JSON-RPC request
Sourcepub fn activation_not_found(
activation: &str,
available: Vec<String>,
) -> ErrorObject<'static>
pub fn activation_not_found( activation: &str, available: Vec<String>, ) -> ErrorObject<'static>
Activation not found - the namespace doesn’t exist
Sourcepub fn method_not_found(
activation: &str,
method: &str,
available_methods: Vec<String>,
example_method: Option<(&str, Vec<Value>)>,
) -> ErrorObject<'static>
pub fn method_not_found( activation: &str, method: &str, available_methods: Vec<String>, example_method: Option<(&str, Vec<Value>)>, ) -> ErrorObject<'static>
Method not found - the activation exists but not the method
Sourcepub fn invalid_params(
method: &str,
message: &str,
usage: Option<&str>,
example: Option<TryRequest>,
) -> ErrorObject<'static>
pub fn invalid_params( method: &str, message: &str, usage: Option<&str>, example: Option<TryRequest>, ) -> ErrorObject<'static>
Invalid params - the method exists but params are wrong
Sourcepub fn internal_error(message: &str) -> ErrorObject<'static>
pub fn internal_error(message: &str) -> ErrorObject<'static>
Internal/execution error
Auto Trait Implementations§
impl Freeze for GuidedError
impl RefUnwindSafe for GuidedError
impl Send for GuidedError
impl Sync for GuidedError
impl Unpin for GuidedError
impl UnsafeUnpin for GuidedError
impl UnwindSafe for GuidedError
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more