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