Struct artichoke_backend::fmt::WriteError
source · pub struct WriteError(_);
Expand description
Error type which converts a fmt::Error
into an Artichoke Error
.
This error type can also be used to convert generic fmt::Error
into an
Error
, such as when formatting integers with write!
.
This error type wraps a fmt::Error
.
Examples
use std::fmt::Write;
fn task() -> Result<String, Error> {
let mut buf = String::new();
write!(&mut buf, "success!").map_err(WriteError::from)?;
Ok(buf)
}
Implementations§
source§impl WriteError
impl WriteError
pub fn into_inner(self) -> Error
Trait Implementations§
source§impl Clone for WriteError
impl Clone for WriteError
source§fn clone(&self) -> WriteError
fn clone(&self) -> WriteError
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for WriteError
impl Debug for WriteError
source§impl Display for WriteError
impl Display for WriteError
source§impl Error for WriteError
impl Error for WriteError
source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
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<Error> for WriteError
impl From<Error> for WriteError
source§impl From<WriteError> for Error
impl From<WriteError> for Error
source§fn from(err: WriteError) -> Self
fn from(err: WriteError) -> 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 RubyException for WriteError
impl RubyException for WriteError
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
.