imessage_database/error/
streamtyped.rs1use std::fmt::{Display, Formatter, Result};
6
7#[derive(Debug)]
9pub enum StreamTypedError {
10 NoStartPattern,
11 NoEndPattern,
12 InvalidPrefix,
13 InvalidTimestamp,
14}
15
16impl Display for StreamTypedError {
17 fn fmt(&self, fmt: &mut Formatter<'_>) -> Result {
18 match self {
19 StreamTypedError::NoStartPattern => write!(fmt, "No start pattern found!"),
20 StreamTypedError::NoEndPattern => write!(fmt, "No end pattern found!"),
21 StreamTypedError::InvalidPrefix => write!(fmt, "Prefix length is not standard!"),
22 StreamTypedError::InvalidTimestamp => write!(fmt, "Timestamp integer is not valid!"),
23 }
24 }
25}