pub struct IpcError {
pub code: i32,
pub message: String,
pub data: Option<Value>,
}Expand description
Error returned in IpcResponse
Fields§
§code: i32Error code (see error code constants)
message: StringHuman-readable error message
data: Option<Value>Additional error data (optional)
Implementations§
Source§impl IpcError
impl IpcError
Sourcepub fn with_data(
code: i32,
message: impl Into<String>,
data: impl Serialize,
) -> Self
pub fn with_data( code: i32, message: impl Into<String>, data: impl Serialize, ) -> Self
Create an error with additional data
Sourcepub fn parse_error() -> Self
pub fn parse_error() -> Self
Parse error
Sourcepub fn invalid_request(reason: impl Into<String>) -> Self
pub fn invalid_request(reason: impl Into<String>) -> Self
Invalid request error
Sourcepub fn method_not_found(method: impl AsRef<str>) -> Self
pub fn method_not_found(method: impl AsRef<str>) -> Self
Method not found error
Sourcepub fn invalid_params(reason: impl Into<String>) -> Self
pub fn invalid_params(reason: impl Into<String>) -> Self
Invalid params error
Sourcepub fn internal_error(reason: impl Into<String>) -> Self
pub fn internal_error(reason: impl Into<String>) -> Self
Internal error
Sourcepub fn param_not_found(id: impl AsRef<str>) -> Self
pub fn param_not_found(id: impl AsRef<str>) -> Self
Parameter not found error
Sourcepub fn param_out_of_range(id: impl AsRef<str>, value: f32) -> Self
pub fn param_out_of_range(id: impl AsRef<str>, value: f32) -> Self
Parameter out of range error
Trait Implementations§
Source§impl<'de> Deserialize<'de> for IpcError
impl<'de> Deserialize<'de> for IpcError
Source§fn 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
Auto Trait Implementations§
impl Freeze for IpcError
impl RefUnwindSafe for IpcError
impl Send for IpcError
impl Sync for IpcError
impl Unpin for IpcError
impl UnwindSafe for IpcError
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