Type Alias jsonrpsee_types::error::ErrorObjectOwned

source ·
pub type ErrorObjectOwned = ErrorObject<'static>;
Expand description

Owned variant of ErrorObject.

Aliased Type§

struct ErrorObjectOwned { /* private fields */ }

Implementations

source§

impl<'a> ErrorObject<'a>

source

pub fn code(&self) -> i32

Return the error code

source

pub fn message(&self) -> &str

Return the message

source

pub fn data(&self) -> Option<&RawValue>

Return the data associated with this error, if any

source

pub fn owned<S: Serialize>( code: i32, message: impl Into<String>, data: Option<S>, ) -> ErrorObject<'static>

Create a new ErrorObjectOwned with optional data.

source

pub fn borrowed( code: i32, message: &'a str, data: Option<&'a RawValue>, ) -> ErrorObject<'a>

Create a new ErrorObject with optional data.

source

pub fn into_owned(self) -> ErrorObject<'static>

Take ownership of the parameters within, if we haven’t already.

source

pub fn borrow(&'a self) -> ErrorObject<'a>

Borrow the current ErrorObject.

Trait Implementations

source§

impl<'a> Clone for ErrorObject<'a>

source§

fn clone(&self) -> ErrorObject<'a>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<'a> Debug for ErrorObject<'a>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'de, 'a> Deserialize<'de> for ErrorObject<'a>

source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl<'a> Display for ErrorObject<'a>

source§

fn fmt(&self, __formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'a> Error for ErrorObject<'a>

1.30.0 · source§

fn source(&self) -> Option<&(dyn Error + 'static)>

The lower-level source of this error, if any. Read more
1.0.0 · source§

fn description(&self) -> &str

👎Deprecated since 1.42.0: use the Display impl or to_string()
1.0.0 · source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type based access to context intended for error reports. Read more
source§

impl<'a> From<ErrorCode> for ErrorObject<'a>

source§

fn from(code: ErrorCode) -> Self

Converts to this type from the input type.
source§

impl<'a> PartialEq for ErrorObject<'a>

source§

fn eq(&self, other: &Self) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<'a> Serialize for ErrorObject<'a>

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more