pub struct RError {
pub kind: REKind,
}
Fields§
§kind: REKind
Implementations§
Source§impl RError
impl RError
Sourcepub fn new(kind_: REKind) -> RError
pub fn new(kind_: REKind) -> RError
Creates a new RError from a known kind of error as well as an arbitrary error payload.
§Examples
use rustr::error::{RError, REKind};
pub fn unknown(x: String) -> RError
pub fn forcestop(x: String) -> RError
pub fn unreachable(x: String) -> RError
pub fn other<E>(x: E) -> RError
pub fn kind(&self) -> &REKind
Trait Implementations§
Source§impl Error for RError
impl Error for RError
Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
Source§fn cause(&self) -> Option<&dyn Error>
fn cause(&self) -> Option<&dyn Error>
👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
Source§impl From<IntoStringError> for RError
impl From<IntoStringError> for RError
Source§fn from(x: IntoStringError) -> RError
fn from(x: IntoStringError) -> RError
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for RError
impl !RefUnwindSafe for RError
impl Send for RError
impl Sync for RError
impl Unpin for RError
impl !UnwindSafe for RError
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