pub struct NcError {
pub int: NcResult_i32,
pub msg: String,
}Expand description
The error type for the Rust methods API.
Fields§
§int: NcResult_i32§msg: StringImplementations§
Source§impl NcError
§Methods
impl NcError
§Methods
Sourcepub fn new() -> Self
pub fn new() -> Self
New NcError with default NCRESULT_ERR
error number, and no message.
Sourcepub fn new_err(int: NcResult_i32) -> Self
pub fn new_err(int: NcResult_i32) -> Self
New NcError with custom error number, and without message.
Sourcepub fn new_msg(msg: &str) -> Self
pub fn new_msg(msg: &str) -> Self
New NcError with default NCRESULT_ERR
error number and a custom message.
Sourcepub fn with_msg(int: NcResult_i32, msg: &str) -> Self
pub fn with_msg(int: NcResult_i32, msg: &str) -> Self
New NcError with both a custom error number and a custom message.
Trait Implementations§
Source§impl Error for NcError
Available on crate feature std only.
impl Error for NcError
Available on crate feature
std only.Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
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
Auto Trait Implementations§
impl Freeze for NcError
impl RefUnwindSafe for NcError
impl Send for NcError
impl Sync for NcError
impl Unpin for NcError
impl UnwindSafe for NcError
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