1mod client;
3pub mod types;
5
6pub use self::client::Client;
7pub use self::types::Deviation;
8pub use self::types::DeviationExtended;
9pub use self::types::GetFullviewUrlError;
10pub use self::types::GetFullviewUrlOptions;
11pub use self::types::ListFolderContentsResponse;
12pub use self::types::OEmbed;
13pub use self::types::ScrapedStashInfo;
14pub use self::types::ScrapedWebPageInfo;
15pub use url::Url;
16
17#[derive(Debug, thiserror::Error)]
19pub enum Error {
20 #[error(transparent)]
22 Reqwest(#[from] reqwest::Error),
23
24 #[error(transparent)]
26 Url(#[from] url::ParseError),
27
28 #[error(transparent)]
30 TokioJoin(#[from] tokio::task::JoinError),
31
32 #[error(transparent)]
34 Json(#[from] serde_json::Error),
35
36 #[error("invalid scraped webpage")]
38 InvalidScrapedWebPage(#[from] self::types::scraped_webpage_info::FromHtmlStrError),
39
40 #[error("invalid scraped stash info")]
42 InvalidScrapedStashInfo(#[from] self::types::scraped_stash_info::FromHtmlStrError),
43
44 #[error("sign in failed")]
46 SignInFailed,
47
48 #[error("missing field \"{name}\"")]
50 MissingField {
51 name: &'static str,
53 },
54
55 #[error("missing streams")]
57 MissingStreams,
58
59 #[error("missing browse page stream")]
61 MissingBrowsePageStream,
62
63 #[error("missing deviation {0}")]
65 MissingDeviation(u64),
66
67 #[error("cookie store error")]
69 CookieStore(WrapBoxError),
70}
71
72#[derive(Debug)]
74pub struct WrapBoxError(pub Box<dyn std::error::Error + Send + Sync + 'static>);
75
76impl std::fmt::Display for WrapBoxError {
77 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
78 self.0.fmt(f)
79 }
80}
81
82impl std::error::Error for WrapBoxError {}
83
84