pub struct Error {
pub code: i64,
pub message: Cow<'static, str>,
pub data: Option<Box<dyn Serialize>>,
}
Fields§
§code: i64
§message: Cow<'static, str>
§data: Option<Box<dyn Serialize>>
Implementations§
Source§impl Error
impl Error
pub const PARSE_ERROR: Error
pub const INVALID_REQUEST: Error
pub const METHOD_NOT_FOUND: Error
pub const INVALID_PARAMS: Error
pub const INTERNAL_ERROR: Error
pub fn custom<S>(code: i64, message: S) -> Error
pub fn with_data<S>(self, data: S) -> Errorwhere
S: Serialize + 'static,
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Error
impl !RefUnwindSafe for Error
impl !Send for Error
impl !Sync for Error
impl Unpin for Error
impl !UnwindSafe for Error
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