mirror of
https://github.com/kristoferssolo/transmission-rpc.git
synced 2025-10-21 20:10:37 +00:00
Enumify the torrent error type
This commit is contained in:
parent
e82d71adc7
commit
4fe84956da
@ -17,6 +17,7 @@ pub use self::request::{
|
|||||||
|
|
||||||
pub(crate) use self::response::RpcResponseArgument;
|
pub(crate) use self::response::RpcResponseArgument;
|
||||||
pub use self::response::{
|
pub use self::response::{
|
||||||
BlocklistUpdate, FreeSpace, Nothing, PortTest, RpcResponse, SessionClose, SessionGet,
|
BlocklistUpdate, ErrorType, FreeSpace, Nothing, PortTest, RpcResponse, SessionClose,
|
||||||
SessionStats, Torrent, TorrentAddedOrDuplicate, TorrentRenamePath, TorrentStatus, Torrents,
|
SessionGet, SessionStats, Torrent, TorrentAddedOrDuplicate, TorrentRenamePath, TorrentStatus,
|
||||||
|
Torrents,
|
||||||
};
|
};
|
||||||
|
|||||||
@ -81,6 +81,15 @@ pub enum TorrentStatus {
|
|||||||
Seeding = 6,
|
Seeding = 6,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Debug, Deserialize_repr)]
|
||||||
|
#[repr(u8)]
|
||||||
|
pub enum ErrorType {
|
||||||
|
Ok = 0,
|
||||||
|
TrackerWarning = 1,
|
||||||
|
TrackerError = 2,
|
||||||
|
LocalError = 3,
|
||||||
|
}
|
||||||
|
|
||||||
#[derive(Deserialize, Debug, Clone)]
|
#[derive(Deserialize, Debug, Clone)]
|
||||||
#[serde(rename_all = "camelCase")]
|
#[serde(rename_all = "camelCase")]
|
||||||
pub struct Torrent {
|
pub struct Torrent {
|
||||||
@ -89,7 +98,7 @@ pub struct Torrent {
|
|||||||
pub done_date: Option<i64>,
|
pub done_date: Option<i64>,
|
||||||
pub download_dir: Option<String>,
|
pub download_dir: Option<String>,
|
||||||
pub edit_date: Option<i64>,
|
pub edit_date: Option<i64>,
|
||||||
pub error: Option<i64>,
|
pub error: Option<ErrorType>,
|
||||||
pub error_string: Option<String>,
|
pub error_string: Option<String>,
|
||||||
pub eta: Option<i64>,
|
pub eta: Option<i64>,
|
||||||
pub id: Option<i64>,
|
pub id: Option<i64>,
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user