Enum etherparse::WriteError
source · pub enum WriteError {
IoError(Error),
ValueError(ValueError),
SliceTooSmall(usize),
}Expand description
Errors that can occur when writing.
Variants§
IoError(Error)
ValueError(ValueError)
Error in the data that was given to write
SliceTooSmall(usize)
Error when a given slice is not big enough to serialize the data.
Implementations§
source§impl WriteError
impl WriteError
sourcepub fn io_error(self) -> Option<Error>
pub fn io_error(self) -> Option<Error>
Returns the std::io::Error value if the WriteError is an IoError.
Otherwise `None is returned.
sourcepub fn value_error(self) -> Option<ValueError>
pub fn value_error(self) -> Option<ValueError>
Returns the std::io::Error value if the WriteError is an ValueError.
Otherwise None is returned.
sourcepub fn slice_too_small_size(self) -> Option<usize>
pub fn slice_too_small_size(self) -> Option<usize>
Returns the expected minimum size if the error is an SliceTooSmall.
Trait Implementations§
source§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§fn from(err: Error) -> WriteError
fn from(err: Error) -> WriteError
Converts to this type from the input type.
source§impl From<ValueError> for WriteError
impl From<ValueError> for WriteError
source§fn from(err: ValueError) -> WriteError
fn from(err: ValueError) -> WriteError
Converts to this type from the input type.