Struct libnotcurses_sys::NcError
source · [−]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: String
Implementations
sourceimpl NcError
impl NcError
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
sourceimpl Error for NcError
impl Error for NcError
sourcefn description(&self) -> &str
fn description(&self) -> &str
👎 Deprecated since 1.42.0:
use the Display impl or to_string()
1.30.0 · sourcefn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
The lower-level source of this error, if any. Read more
Auto Trait Implementations
impl RefUnwindSafe for NcError
impl Send for NcError
impl Sync for NcError
impl Unpin for NcError
impl UnwindSafe for NcError
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more