mod client;
pub mod types;
pub use self::client::Client;
pub use self::types::Deviation;
pub use self::types::DeviationExtended;
pub use self::types::OEmbed;
pub use self::types::ScrapedStashInfo;
pub use self::types::ScrapedWebPageInfo;
#[derive(Debug, thiserror::Error)]
pub enum Error {
#[error(transparent)]
Reqwest(#[from] reqwest::Error),
#[error(transparent)]
Url(#[from] url::ParseError),
#[error(transparent)]
TokioJoin(#[from] tokio::task::JoinError),
#[error(transparent)]
Json(#[from] serde_json::Error),
#[error("invalid scraped webpage")]
InvalidScrapedWebPage(#[from] self::types::scraped_webpage_info::FromHtmlStrError),
#[error("invalid scraped stash info")]
InvalidScrapedStashInfo(#[from] self::types::scraped_stash_info::FromHtmlStrError),
#[error("sign in failed")]
SignInFailed,
#[error("missing field \"{name}\"")]
MissingField {
name: &'static str,
},
#[error("missing streams")]
MissingStreams,
#[error("missing browse page stream")]
MissingBrowsePageStream,
#[error("missing deviation {0}")]
MissingDeviation(u64),
#[error("cookie store error")]
CookieStore(WrapBoxError),
}
#[derive(Debug)]
pub struct WrapBoxError(pub Box<dyn std::error::Error + Send + Sync + 'static>);
impl std::fmt::Display for WrapBoxError {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
self.0.fmt(f)
}
}
impl std::error::Error for WrapBoxError {}