pub struct ZvecError {
pub code: ErrorCode,
pub message: Option<String>,
}Expand description
Error returned by fallible safe wrappers over the zvec C API.
The message field, when present, is the last-error message retrieved via
sys::zvec_get_last_error at the time the error was constructed.
Fields§
§code: ErrorCode§message: Option<String>Implementations§
Source§impl ZvecError
impl ZvecError
Sourcepub fn from_code(code: Type) -> Self
pub fn from_code(code: Type) -> Self
Construct an error from a raw code, pulling the current thread-local message out of the C API if one is set.
Sourcepub fn with_message(code: ErrorCode, message: impl Into<String>) -> Self
pub fn with_message(code: ErrorCode, message: impl Into<String>) -> Self
Construct an error with a static message (used for cases where the C
API did not provide a detailed message, e.g. NULL-returning creators).
Trait Implementations§
Source§impl Error for ZvecError
impl Error for ZvecError
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 ZvecError
impl RefUnwindSafe for ZvecError
impl Send for ZvecError
impl Sync for ZvecError
impl Unpin for ZvecError
impl UnsafeUnpin for ZvecError
impl UnwindSafe for ZvecError
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