pub enum TranscodeError<L> {
Conversion {
line_no: u32,
error: L,
},
Io(Error),
}
Expand description
Errors resulting from a transcoding operation.
Variants§
Implementations§
Source§impl<L> TranscodeError<L>
impl<L> TranscodeError<L>
Sourcepub fn into_conversion_error(self) -> Option<(u32, L)>
pub fn into_conversion_error(self) -> Option<(u32, L)>
Maps the error into a TranscodeError::Conversion
.
Sourcepub fn into_io_error(self) -> Option<Error>
pub fn into_io_error(self) -> Option<Error>
Maps the error into a TranscodeError::Io
.
Source§impl<L: Into<Box<dyn Error>>> TranscodeError<L>
impl<L: Into<Box<dyn Error>>> TranscodeError<L>
Sourcepub fn into_dynamic(self) -> TranscodeError<Box<dyn Error>>
pub fn into_dynamic(self) -> TranscodeError<Box<dyn Error>>
Boxes the given error if it is a TranscodeError::Conversion
, returning the line error as an Error
trait.
This is useful for working with methods that return a generic Result<_, Box<dyn Error>>
.
Trait Implementations§
Source§impl<L: Debug> Debug for TranscodeError<L>
impl<L: Debug> Debug for TranscodeError<L>
Source§impl<L: Display + Debug> Error for TranscodeError<L>
impl<L: Display + Debug> Error for TranscodeError<L>
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()
Auto Trait Implementations§
impl<L> Freeze for TranscodeError<L>where
L: Freeze,
impl<L> !RefUnwindSafe for TranscodeError<L>
impl<L> Send for TranscodeError<L>where
L: Send,
impl<L> Sync for TranscodeError<L>where
L: Sync,
impl<L> Unpin for TranscodeError<L>where
L: Unpin,
impl<L> !UnwindSafe for TranscodeError<L>
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