pub struct Error(/* private fields */);
Expand description
The Error
type, a wrapper around a dynamic exception type.
Error
works a lot like Box<dyn std::error::Error>
, but with these
differences:
Error
requires that the error is'static
.Error
requires that the error implementRubyException
.Error
can convert itself to a backtrace on the underlying Ruby VM.
All types that implement RubyException
are able to be converted to
Error
.
Trait Implementations§
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()
Source§impl From<ArenaSavepointError> for Error
impl From<ArenaSavepointError> for Error
Source§fn from(exception: ArenaSavepointError) -> Self
fn from(exception: ArenaSavepointError) -> Self
Converts to this type from the input type.
Source§impl From<ArgCountError> for Error
impl From<ArgCountError> for Error
Source§fn from(exception: ArgCountError) -> Self
fn from(exception: ArgCountError) -> Self
Converts to this type from the input type.
Source§impl From<ArgumentError> for Error
impl From<ArgumentError> for Error
Source§fn from(err: EnvArgumentError) -> Self
fn from(err: EnvArgumentError) -> Self
Converts to this type from the input type.
Source§impl From<ArgumentError> for Error
impl From<ArgumentError> for Error
Source§fn from(exception: ArgumentError) -> Error
fn from(exception: ArgumentError) -> Error
Converts to this type from the input type.
Source§impl From<ArgumentError> for Error
impl From<ArgumentError> for Error
Source§fn from(err: ArgumentError) -> Self
fn from(err: ArgumentError) -> Self
Converts to this type from the input type.
Source§impl From<ArgumentError> for Error
impl From<ArgumentError> for Error
Source§fn from(err: ArgumentError) -> Self
fn from(err: ArgumentError) -> Self
Converts to this type from the input type.
Source§impl From<Box<dyn RubyException>> for Error
impl From<Box<dyn RubyException>> for Error
Source§fn from(exc: Box<dyn RubyException>) -> Self
fn from(exc: Box<dyn RubyException>) -> Self
Converts to this type from the input type.
Source§impl From<BoxIntoRubyError> for Error
impl From<BoxIntoRubyError> for Error
Source§fn from(exception: BoxIntoRubyError) -> Self
fn from(exception: BoxIntoRubyError) -> Self
Converts to this type from the input type.
Source§impl From<CaughtException> for Error
impl From<CaughtException> for Error
Source§fn from(exc: CaughtException) -> Self
fn from(exc: CaughtException) -> Self
Converts to this type from the input type.
Source§impl From<ConstantNameError> for Error
impl From<ConstantNameError> for Error
Source§fn from(exception: ConstantNameError) -> Self
fn from(exception: ConstantNameError) -> Self
Converts to this type from the input type.
Source§impl From<ConvertBytesError> for Error
impl From<ConvertBytesError> for Error
Source§fn from(exception: ConvertBytesError) -> Self
fn from(exception: ConvertBytesError) -> Self
Converts to this type from the input type.
Source§impl From<DomainError> for Error
impl From<DomainError> for Error
Source§fn from(exception: DomainError) -> Self
fn from(exception: DomainError) -> Self
Converts to this type from the input type.
Source§impl From<DomainError> for Error
impl From<DomainError> for Error
Source§fn from(err: DomainError) -> Self
fn from(err: DomainError) -> Self
Converts to this type from the input type.
Source§impl From<EncodingError> for Error
impl From<EncodingError> for Error
Source§fn from(exception: EncodingError) -> Error
fn from(exception: EncodingError) -> Error
Converts to this type from the input type.
Source§impl From<Error> for Error
impl From<Error> for Error
Source§fn from(err: SecureRandomError) -> Self
fn from(err: SecureRandomError) -> Self
Converts to this type from the input type.
Source§impl From<FiberError> for Error
impl From<FiberError> for Error
Source§fn from(exception: FiberError) -> Error
fn from(exception: FiberError) -> Error
Converts to this type from the input type.
Source§impl From<FloatDomainError> for Error
impl From<FloatDomainError> for Error
Source§fn from(exception: FloatDomainError) -> Error
fn from(exception: FloatDomainError) -> Error
Converts to this type from the input type.
Source§impl From<FrozenError> for Error
impl From<FrozenError> for Error
Source§fn from(exception: FrozenError) -> Error
fn from(exception: FrozenError) -> Error
Converts to this type from the input type.
Source§impl From<IncrementLinenoError> for Error
impl From<IncrementLinenoError> for Error
Source§fn from(exception: IncrementLinenoError) -> Self
fn from(exception: IncrementLinenoError) -> Self
Converts to this type from the input type.
Source§impl From<IndexError> for Error
impl From<IndexError> for Error
Source§fn from(exception: IndexError) -> Error
fn from(exception: IndexError) -> Error
Converts to this type from the input type.
Source§impl From<InitializeError> for Error
impl From<InitializeError> for Error
Source§fn from(err: InitializeError) -> Self
fn from(err: InitializeError) -> Self
Converts to this type from the input type.
Source§impl From<InterpreterExtractError> for Error
impl From<InterpreterExtractError> for Error
Source§fn from(exception: InterpreterExtractError) -> Self
fn from(exception: InterpreterExtractError) -> Self
Converts to this type from the input type.
Source§impl From<InvalidError> for Error
impl From<InvalidError> for Error
Source§fn from(err: InvalidError) -> Self
fn from(err: InvalidError) -> Self
Converts to this type from the input type.
Source§impl From<LocalJumpError> for Error
impl From<LocalJumpError> for Error
Source§fn from(exception: LocalJumpError) -> Error
fn from(exception: LocalJumpError) -> Error
Converts to this type from the input type.
Source§impl From<NewSeedError> for Error
impl From<NewSeedError> for Error
Source§fn from(err: NewSeedError) -> Self
fn from(err: NewSeedError) -> Self
Converts to this type from the input type.
Source§impl From<NoBlockGiven> for Error
impl From<NoBlockGiven> for Error
Source§fn from(exception: NoBlockGiven) -> Self
fn from(exception: NoBlockGiven) -> Self
Converts to this type from the input type.
Source§impl From<NoMemoryError> for Error
impl From<NoMemoryError> for Error
Source§fn from(exception: NoMemoryError) -> Error
fn from(exception: NoMemoryError) -> Error
Converts to this type from the input type.
Source§impl From<NoMethodError> for Error
impl From<NoMethodError> for Error
Source§fn from(exception: NoMethodError) -> Error
fn from(exception: NoMethodError) -> Error
Converts to this type from the input type.
Source§impl From<NotDefinedError> for Error
impl From<NotDefinedError> for Error
Source§fn from(exception: NotDefinedError) -> Self
fn from(exception: NotDefinedError) -> Self
Converts to this type from the input type.
Source§impl From<NotImplementedError> for Error
impl From<NotImplementedError> for Error
Source§fn from(exception: NotImplementedError) -> Error
fn from(exception: NotImplementedError) -> Error
Converts to this type from the input type.
Source§impl From<NotImplementedError> for Error
impl From<NotImplementedError> for Error
Source§fn from(err: MathNotImplementedError) -> Self
fn from(err: MathNotImplementedError) -> Self
Converts to this type from the input type.
Source§impl From<RandomBytesError> for Error
impl From<RandomBytesError> for Error
Source§fn from(err: RandomBytesError) -> Self
fn from(err: RandomBytesError) -> Self
Converts to this type from the input type.
Source§impl From<RangeError> for Error
impl From<RangeError> for Error
Source§fn from(exception: RangeError) -> Error
fn from(exception: RangeError) -> Error
Converts to this type from the input type.
Source§impl From<RegexpError> for Error
impl From<RegexpError> for Error
Source§fn from(exception: RegexpError) -> Error
fn from(exception: RegexpError) -> Error
Converts to this type from the input type.
Source§impl From<RuntimeError> for Error
impl From<RuntimeError> for Error
Source§fn from(exception: RuntimeError) -> Error
fn from(exception: RuntimeError) -> Error
Converts to this type from the input type.
Source§impl From<ScriptError> for Error
impl From<ScriptError> for Error
Source§fn from(exception: ScriptError) -> Error
fn from(exception: ScriptError) -> Error
Converts to this type from the input type.
Source§impl From<SecurityError> for Error
impl From<SecurityError> for Error
Source§fn from(exception: SecurityError) -> Error
fn from(exception: SecurityError) -> Error
Converts to this type from the input type.
Source§impl From<SignalException> for Error
impl From<SignalException> for Error
Source§fn from(exception: SignalException) -> Error
fn from(exception: SignalException) -> Error
Converts to this type from the input type.
Source§impl From<StandardError> for Error
impl From<StandardError> for Error
Source§fn from(exception: StandardError) -> Error
fn from(exception: StandardError) -> Error
Converts to this type from the input type.
Source§impl From<StopIteration> for Error
impl From<StopIteration> for Error
Source§fn from(exception: StopIteration) -> Error
fn from(exception: StopIteration) -> Error
Converts to this type from the input type.
Source§impl From<SymbolOverflowError> for Error
impl From<SymbolOverflowError> for Error
Source§fn from(exception: SymbolOverflowError) -> Self
fn from(exception: SymbolOverflowError) -> Self
Converts to this type from the input type.
Source§impl From<SyntaxError> for Error
impl From<SyntaxError> for Error
Source§fn from(exception: SyntaxError) -> Error
fn from(exception: SyntaxError) -> Error
Converts to this type from the input type.
Source§impl From<SystemCallError> for Error
impl From<SystemCallError> for Error
Source§fn from(exception: SystemCallError) -> Error
fn from(exception: SystemCallError) -> Error
Converts to this type from the input type.
Source§impl From<SystemExit> for Error
impl From<SystemExit> for Error
Source§fn from(exception: SystemExit) -> Error
fn from(exception: SystemExit) -> Error
Converts to this type from the input type.
Source§impl From<SystemStackError> for Error
impl From<SystemStackError> for Error
Source§fn from(exception: SystemStackError) -> Error
fn from(exception: SystemStackError) -> Error
Converts to this type from the input type.
Source§impl From<ThreadError> for Error
impl From<ThreadError> for Error
Source§fn from(exception: ThreadError) -> Error
fn from(exception: ThreadError) -> Error
Converts to this type from the input type.
Source§impl From<UnboxRubyError> for Error
impl From<UnboxRubyError> for Error
Source§fn from(exception: UnboxRubyError) -> Self
fn from(exception: UnboxRubyError) -> Self
Converts to this type from the input type.
Source§impl From<UncaughtThrowError> for Error
impl From<UncaughtThrowError> for Error
Source§fn from(exception: UncaughtThrowError) -> Error
fn from(exception: UncaughtThrowError) -> Error
Converts to this type from the input type.
Source§impl From<UrandomError> for Error
impl From<UrandomError> for Error
Source§fn from(err: UrandomError) -> Self
fn from(err: UrandomError) -> Self
Converts to this type from the input type.
Source§impl From<WriteError> for Error
impl From<WriteError> for Error
Source§fn from(exception: WriteError) -> Self
fn from(exception: WriteError) -> Self
Converts to this type from the input type.
Source§impl From<ZeroDivisionError> for Error
impl From<ZeroDivisionError> for Error
Source§fn from(exception: ZeroDivisionError) -> Error
fn from(exception: ZeroDivisionError) -> Error
Converts to this type from the input type.
Source§impl RubyException for Error
impl RubyException for Error
Source§fn vm_backtrace(&self, interp: &mut Artichoke) -> Option<Vec<Vec<u8>>>
fn vm_backtrace(&self, interp: &mut Artichoke) -> Option<Vec<Vec<u8>>>
Optional backtrace specified by a
Vec
of frames.Source§fn as_mrb_value(&self, interp: &mut Artichoke) -> Option<mrb_value>
fn as_mrb_value(&self, interp: &mut Artichoke) -> Option<mrb_value>
Return a raise-able
sys::mrb_value
.Auto Trait Implementations§
impl Freeze for Error
impl !RefUnwindSafe for Error
impl !Send for Error
impl !Sync for Error
impl Unpin 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