adb_client_tokio/
util.rs

1use thiserror::Error;
2
3/// Result type for adb-client-tokio
4pub type Result<T> = std::result::Result<T, AdbError>;
5
6/// Error type for adb-client-tokio
7#[derive(Error, Debug)]
8pub enum AdbError {
9    /// Indicates that an error occurred with I/O.
10    #[error(transparent)]
11    IOError(#[from] std::io::Error),
12    /// Indicates that an error occurred during UTF-8 parsing.
13    #[error(transparent)]
14    Utf8StringError(#[from] std::str::Utf8Error),
15    /// Indicates that an error occurred during integer parsing.
16    #[error(transparent)]
17    ParseIntError(#[from] std::num::ParseIntError),
18    /// Indicates that an error occurred with the ADB server.
19    #[error("FAILED response status: {0}")]
20    FailedResponseStatus(String),
21    /// Indicates that an unknown response status was received.
22    #[error("Unknown response status: {0}")]
23    UnknownResponseStatus(String),
24    /// Indicates that an addr couldn;'t be parsed
25    #[error(transparent)]
26    AddrParseError(#[from] std::net::AddrParseError),
27}