brec 0.4.0

A flexible binary format for storing and streaming structured data as packets with CRC protection and recoverability from corruption. Built for extensibility and robustness.
Documentation
use thiserror::Error;

#[derive(Error, Debug)]
pub enum SensorError {
    #[error("Expected file, but {0} isn't a file")]
    NotFile(String),
    #[error("IO Error: {0}")]
    Io(#[from] std::io::Error),
    #[error("Send Error")]
    SendError,
    #[error("Notify Error: {0}")]
    NotifyError(#[from] notify::Error),
    #[error("Disconnected")]
    Disconnected,
}

impl<T> From<tokio::sync::mpsc::error::SendError<T>> for SensorError {
    fn from(_: tokio::sync::mpsc::error::SendError<T>) -> Self {
        SensorError::SendError
    }
}