pub struct WriteError(/* private fields */);
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)>
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<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
.impl Copy for WriteError
Auto Trait Implementations§
impl Freeze for WriteError
impl RefUnwindSafe for WriteError
impl Send for WriteError
impl Sync for WriteError
impl Unpin for WriteError
impl UnwindSafe for WriteError
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