pub enum DictError {
InvalidCharacter(char, Option<usize>, Option<usize>),
MissingColumnInIndex(usize),
InvalidFileFormat(String, Option<String>),
MemoryError,
WordNotFound(String),
IoError(Error),
Utf8Error(FromUtf8Error),
DeflateError(DecompressError),
}Expand description
Error type, representing the errors which can be returned by the libdict library.
This enum represents a handful of custom errors and wraps io:::Error and
string::FromUtf8Error.
Variants§
InvalidCharacter(char, Option<usize>, Option<usize>)
Invalid character, e.g. within the index file; the error contains the erroneous character, and optionally line and position.
MissingColumnInIndex(usize)
Occurs whenever a line in an index file misses a column.
InvalidFileFormat(String, Option<String>)
Invalid file format, contains an explanation an optional path to the file with the invalid file format.
MemoryError
This reports a malicious / malformed index file, which requests a buffer which is too large.
WordNotFound(String)
This reports words which are not present in the dictionary.
IoError(Error)
A wrapped io::Error.
Utf8Error(FromUtf8Error)
A wrapped Utf8Error.
DeflateError(DecompressError)
Errors thrown by the flate2 crate - not really descriptive errors, though.
Trait Implementations§
Source§impl Error for DictError
impl Error for DictError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
Source§impl From<DecompressError> for DictError
impl From<DecompressError> for DictError
Source§fn from(err: DecompressError) -> DictError
fn from(err: DecompressError) -> DictError
Source§impl From<FromUtf8Error> for DictError
impl From<FromUtf8Error> for DictError
Source§fn from(err: FromUtf8Error) -> DictError
fn from(err: FromUtf8Error) -> DictError
Auto Trait Implementations§
impl Freeze for DictError
impl !RefUnwindSafe for DictError
impl Send for DictError
impl Sync for DictError
impl Unpin for DictError
impl !UnwindSafe for DictError
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
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> DowncastSend for T
impl<T> DowncastSend for T
§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.