Crate quickfetch
source ·Expand description
§QuickFetch
Developed by Mustafif Khan | MoKa Reads 2024
This library is under the MIT License
This library is built to handle multiple requests within a Client
(reqwest
client which will handle it all under a Client Pool)
, cache the response results, and handle these in parallel and asynchronously.
The goal is to be a one-stop shop for handling local package manager development to handle multiple packages with a local cache to easily update, get and remove the different responses.
§Example
use quickfetch::{Fetcher,package::{Package, Config}, FetchMethod};
use quickfetch_traits::Entry;
use quickfetch::home_plus;
#[tokio::main]
async fn main() -> anyhow::Result<()> {
quickfetch::pretty_env_logger::init();
let config: Config<Package> = Config::from_toml_file("examples/pkgs.toml").await?;
// store db in $HOME/.quickfetch
let mut fetcher: Fetcher<Package> = Fetcher::new(config.packages(), home_plus(".quickfetch"))?;
fetcher.fetch(FetchMethod::Channel).await?;
// write the packages to $HOME/pkgs
fetcher.write_all(home_plus("pkgs")).await?;
Ok(())
}
Re-exports§
pub use pretty_env_logger;
pub use bincode;
pub use quickfetch_derive as macros;
pub use quickfetch_traits as traits;
Modules§
- Provides different types of encryption methods that can be used
- Provides different types of packages that can be used
Structs§
- Fetcher struct that will be used to fetch and cache data
Enums§
FetchMethod
enum to specify the method of fetching the responseResponseMethod
enum to specify the method of fetching the response
Functions§
- Returns the path to the home directory with the sub directory appended