summaryrefslogtreecommitdiff
path: root/src/error.rs
blob: fed741ac279da8104303cf938062df8e32f4f93a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
use std;

use tag::Tag;

/// Error types generated by this implementation
#[derive(Debug)]
pub enum Error {
    /// The associated tag was added to an `RtMessage` in non-increasing order.
    TagNotStrictlyIncreasing(Tag),

    /// Encoding failed. The associated `std::io::Error` should provide
    /// more information.
    EncodingFailure(std::io::Error),
}

impl From<std::io::Error> for Error {
    fn from(err: std::io::Error) -> Self {
        Error::EncodingFailure(err)
    }
}