Fields
code: i32message: Stringdata: Option<Value>Implementations
sourceimpl Error
impl Error
pub const PARSE_ERROR: i32 = -32_700i32
pub const INVALID_REQUEST: i32 = -32_600i32
pub const METHOD_NOT_FOUND: i32 = -32_601i32
pub const INVALID_PARAMS: i32 = -32_602i32
pub const INTERNAL_ERROR: i32 = -32_603i32
pub const BAD_REQUEST: i32 = -32_000i32
pub const BAD_RESPONSE: i32 = -32_001i32
pub const REMOTE_DISCONNECTED: i32 = -32_002i32
pub fn new(code: i32, message: impl ToString) -> Self
pub fn with_data(code: i32, message: String, data: Option<Value>) -> Self
pub fn invalid_params() -> Self
pub fn method_not_found() -> Self
pub fn invalid_args_len(n: usize) -> Self
pub fn bad_response() -> Self
pub fn bad_request() -> Self
pub fn remote_disconnected() -> Self
pub fn is_disconnnected(&self) -> bool
Trait Implementations
sourceimpl<'de> Deserialize<'de> for Error
impl<'de> Deserialize<'de> for Error
sourcefn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
sourceimpl Error for Error
impl Error for Error
1.30.0 · sourcefn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
The lower-level source of this error, if any. Read more
sourcefn backtrace(&self) -> Option<&Backtrace>
fn backtrace(&self) -> Option<&Backtrace>
🔬 This is a nightly-only experimental API. (
backtrace)Returns a stack backtrace, if available, of where this error occurred. Read more
1.0.0 · sourcefn description(&self) -> &str
fn description(&self) -> &str
👎 Deprecated since 1.42.0:
use the Display impl or to_string()
sourceimpl TypeDef for Error
impl TypeDef for Error
sourceconst INFO: TypeInfo = {
::typescript_type_def::type_expr::TypeInfo::Defined(::typescript_type_def::type_expr::DefinedTypeInfo{def:
::typescript_type_def::type_expr::TypeDefinition{docs:
::core::option::Option::None,
path: &[],
name: ::typescript_type_def::type_expr::Ident("Error"),
generic_vars: &[],
def:
::typescript_type_def::type_expr::TypeExpr::Object(::typescript_type_def::type_expr::TypeObject{docs:
::core::option::Option::None,
index_signature: ::core::option::Option::None,
fields:
&[::typescript_type_def::type_expr::ObjectField{docs:
::core::option::Option::None,
name:
::typescript_type_def::type_expr::TypeString{docs:
::core::option::Option::None,
value: "code",},
optional: false,
r#type:
::typescript_type_def::type_expr::TypeExpr::Ref(&::INFO),},
::typescript_type_def::type_expr::ObjectField{docs:
::core::option::Option::None,
name:
::typescript_type_def::type_expr::TypeString{docs:
::core::option::Option::None,
value: "message",},
optional: false,
r#type:
::typescript_type_def::type_expr::TypeExpr::Ref(&::INFO),},
::typescript_type_def::type_expr::ObjectField{docs:
::core::option::Option::None,
name:
::typescript_type_def::type_expr::TypeString{docs:
::core::option::Option::None,
value: "data",},
optional: true,
r#type:
::typescript_type_def::type_expr::TypeExpr::Ref(&::INFO),}],}),},
generic_args: &[],})
}
const INFO: TypeInfo = {
::typescript_type_def::type_expr::TypeInfo::Defined(::typescript_type_def::type_expr::DefinedTypeInfo{def:
::typescript_type_def::type_expr::TypeDefinition{docs:
::core::option::Option::None,
path: &[],
name: ::typescript_type_def::type_expr::Ident("Error"),
generic_vars: &[],
def:
::typescript_type_def::type_expr::TypeExpr::Object(::typescript_type_def::type_expr::TypeObject{docs:
::core::option::Option::None,
index_signature: ::core::option::Option::None,
fields:
&[::typescript_type_def::type_expr::ObjectField{docs:
::core::option::Option::None,
name:
::typescript_type_def::type_expr::TypeString{docs:
::core::option::Option::None,
value: "code",},
optional: false,
r#type:
::typescript_type_def::type_expr::TypeExpr::Ref(&::INFO),},
::typescript_type_def::type_expr::ObjectField{docs:
::core::option::Option::None,
name:
::typescript_type_def::type_expr::TypeString{docs:
::core::option::Option::None,
value: "message",},
optional: false,
r#type:
::typescript_type_def::type_expr::TypeExpr::Ref(&::INFO),},
::typescript_type_def::type_expr::ObjectField{docs:
::core::option::Option::None,
name:
::typescript_type_def::type_expr::TypeString{docs:
::core::option::Option::None,
value: "data",},
optional: true,
r#type:
::typescript_type_def::type_expr::TypeExpr::Ref(&::INFO),}],}),},
generic_args: &[],})
}
A constant value describing the structure of this type. Read more
Auto Trait Implementations
impl RefUnwindSafe for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl UnwindSafe for Error
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more