]>
git.proxmox.com Git - rustc.git/blob - vendor/fst/src/error.rs
6 /// A `Result` type alias for this crate's `Error` type.
7 pub type Result
<T
> = std
::result
::Result
<T
, Error
>;
9 /// An error that encapsulates all possible errors in this crate.
12 /// An error that occurred while reading or writing a finite state
15 /// An IO error that occurred while writing a finite state transducer.
19 impl From
<io
::Error
> for Error
{
21 fn from(err
: io
::Error
) -> Error
{
26 impl From
<raw
::Error
> for Error
{
28 fn from(err
: raw
::Error
) -> Error
{
33 impl fmt
::Display
for Error
{
34 fn fmt(&self, f
: &mut fmt
::Formatter
<'_
>) -> fmt
::Result
{
36 Error
::Fst(_
) => write
!(f
, "FST error"),
37 Error
::Io(_
) => write
!(f
, "I/O error"),
42 impl std
::error
::Error
for Error
{
43 fn source(&self) -> Option
<&(dyn std
::error
::Error
+ '
static)> {
45 Error
::Fst(ref err
) => Some(err
),
46 Error
::Io(ref err
) => Some(err
),