Struct polymath::PolymathError
source · pub struct PolymathError {
pub error_kind: PolymathErrorKind,
pub error: String,
}Fields§
§error_kind: PolymathErrorKind§error: StringImplementations§
source§impl PolymathError
impl PolymathError
sourcepub fn new(error_kind: PolymathErrorKind, error: &str) -> Self
pub fn new(error_kind: PolymathErrorKind, error: &str) -> Self
Create a new Polymath error
sourcepub fn other(error: &str) -> Self
pub fn other(error: &str) -> Self
Same as PolymathError::new(), with the error kind auto set to: Other
Examples:
use polymath::{PolymathError, PolymathErrorKind};
fn main() {
let error1 = PolymathError::new(PolymathErrorKind::Other, "This is an error!");
let error2 = PolymathError::other("This is an error!");
assert!(error1 == error2);
}Trait Implementations§
source§impl Clone for PolymathError
impl Clone for PolymathError
source§fn clone(&self) -> PolymathError
fn clone(&self) -> PolymathError
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moresource§impl Debug for PolymathError
impl Debug for PolymathError
source§impl Hash for PolymathError
impl Hash for PolymathError
source§impl Ord for PolymathError
impl Ord for PolymathError
source§fn cmp(&self, other: &PolymathError) -> Ordering
fn cmp(&self, other: &PolymathError) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere Self: Sized,
Compares and returns the maximum of two values. Read more
source§impl PartialEq for PolymathError
impl PartialEq for PolymathError
source§fn eq(&self, other: &PolymathError) -> bool
fn eq(&self, other: &PolymathError) -> bool
This method tests for
self and other values to be equal, and is used
by ==.source§impl PartialOrd for PolymathError
impl PartialOrd for PolymathError
source§fn partial_cmp(&self, other: &PolymathError) -> Option<Ordering>
fn partial_cmp(&self, other: &PolymathError) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self and other) and is used by the <=
operator. Read moreimpl Eq for PolymathError
impl StructuralEq for PolymathError
impl StructuralPartialEq for PolymathError
Auto Trait Implementations§
impl RefUnwindSafe for PolymathError
impl Send for PolymathError
impl Sync for PolymathError
impl Unpin for PolymathError
impl UnwindSafe for PolymathError
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