async_osc/
error.rs

1/// Error type for OSC operations.
2///
3/// An error type for the errors that may happen while sending or receiving messages over an OSC
4/// socket.
5#[derive(thiserror::Error, Debug)]
6pub enum Error {
7    /// IO error
8    #[error("IO error")]
9    Io(#[from] std::io::Error),
10    /// OSC decode error
11    #[error("Decode OSC packet failed")]
12    Osc(rosc::OscError),
13}
14
15impl From<rosc::OscError> for Error {
16    fn from(error: rosc::OscError) -> Self {
17        Self::Osc(error)
18    }
19}
20
21/// Result type for OSC operations.
22pub type Result<T> = std::result::Result<T, Error>;