rustup_available_packages/
lib.rs

1//! [![Travis CI badge](https://api.travis-ci.com/rust-lang/rustup-components-history.svg?branch=master)](https://travis-ci.com/github/rust-lang/rustup-components-history)
2//! [![crates.io](https://img.shields.io/crates/v/rustup-available-packages.svg)](https://crates.io/crates/rustup-available-packages)
3//! [![docs.rs](https://docs.rs/rustup-available-packages/badge.svg)](https://docs.rs/rustup-available-packages)
4//!
5//! [[Release docs]](https://docs.rs/rustup-available-packages/)
6//!
7//! A library that helps you to find out which packages are available in your **rustup** tool for
8//! specific dates and targets.
9//!
10//! Suggestions and critiques are welcome!
11
12#![deny(missing_docs)]
13
14pub mod availability;
15pub mod cache;
16mod downloader;
17pub mod manifest;
18mod skip_errors;
19mod source;
20pub mod table;
21mod types;
22
23pub use availability::AvailabilityData;
24pub use downloader::Downloader;
25pub use source::{DefaultSource, SourceInfo};
26use std::io;
27
28/// An error that might happen inside the library.
29#[derive(Debug, thiserror::Error)]
30pub enum Error {
31    /// TOML parsing error.
32    #[error("TOML deserialization error {0} on manifest {1}")]
33    TomlDe(#[source] toml::de::Error, String),
34
35    /// TOML serialization error.
36    #[error("TOML serialization error {0} on manifest {1}")]
37    TomlSer(#[source] toml::ser::Error, String),
38
39    /// Error in the `reqwest` library.
40    #[error("reqwest error {0} on url {1}")]
41    Reqwest(#[source] reqwest::Error, String),
42
43    /// Got a bad HTTP response.
44    #[error("HTTP error {0} on url {1}")]
45    BadResponse(reqwest::StatusCode, String),
46
47    /// I/O error.
48    #[error("I/O error {0} at {1}")]
49    Io(#[source] io::Error, String),
50}