pub struct Error { /* private fields */ }Expand description
An error reported by the igraph C library, or raised by a wrapper that validated its arguments on the Rust side.
It carries the ErrorKind, the raw code, and the message, source file
and line recorded by igraph’s error handler (for errors raised in Rust,
the file is empty and the line is 0). Display prints
<description>: <message> (<file>:<line>).
Implementations§
Source§impl Error
impl Error
Sourcepub fn new(kind: ErrorKind, message: impl Into<String>) -> Self
pub fn new(kind: ErrorKind, message: impl Into<String>) -> Self
Builds an error from its parts; mainly useful to wrappers that validate arguments on the Rust side before calling into igraph.
Sourcepub fn invalid(message: impl Into<String>) -> Self
pub fn invalid(message: impl Into<String>) -> Self
Shorthand for an ErrorKind::InvalidValue error raised on the Rust side.
Sourcepub fn code(&self) -> igraph_error_t
pub fn code(&self) -> igraph_error_t
The raw igraph error code.
Trait Implementations§
impl Eq for Error
Source§impl Error for Error
impl Error for Error
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()
impl StructuralPartialEq for Error
Auto Trait Implementations§
impl Freeze for Error
impl RefUnwindSafe for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl UnsafeUnpin 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