pub struct IppanelError {
pub message: String,
pub code: ErrorCode,
}Expand description
Represents an error returned by the IPPanel API or client.
Contains the error message and the error code as an ErrorCode enum.
Fields§
§message: String§code: ErrorCodeImplementations§
Source§impl IppanelError
impl IppanelError
pub fn new(message: impl Into<String>, code: i32) -> Self
pub fn unwrap(&self) -> &str
pub fn code(&self) -> ErrorCode
pub fn parse_api_error(response: &Value) -> Option<IppanelError>
pub fn to_persian_message(&self) -> &'static str
pub fn to_english_message(&self) -> &'static str
Trait Implementations§
Source§impl Debug for IppanelError
impl Debug for IppanelError
Source§impl Display for IppanelError
impl Display for IppanelError
Source§impl Error for IppanelError
impl Error for IppanelError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
Auto Trait Implementations§
impl Freeze for IppanelError
impl RefUnwindSafe for IppanelError
impl Send for IppanelError
impl Sync for IppanelError
impl Unpin for IppanelError
impl UnsafeUnpin for IppanelError
impl UnwindSafe for IppanelError
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
impl<T> ErasedDestructor for Twhere
T: 'static,
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> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.