[][src]Crate fetch_unroll

Simple functions intended to use in Rust build.rs scripts for tasks which related to fetching from HTTP and unrolling .tar.gz archives with precompiled binaries and etc.

use fetch_unroll::{
    Config,
    fetch_unroll,
};

let pack_url = format!(
    "{base}/{user}/{repo}/releases/download/{ver}/{pkg}_{prof}.tar.gz",
    base = "https://github.com",
    user = "katyo",
    repo = "oboe-rs",
    pkg = "liboboe-ext",
    ver = "0.1.0",
    prof = "release",
);

let dest_dir = "target/test_download";

// Creating destination directory
std::fs::create_dir_all(dest_dir).unwrap();

// Fetching and unrolling archive
fetch_unroll(pack_url, dest_dir, Config::default()).unwrap();

Structs

Config

Configuration options

Enums

Error

Error type

Functions

fetch

Fetch url with limited redirect

fetch_unroll

Fetch archive from url and unroll to directory

unroll

Unroll packed data (.tar.gz)

Type Definitions

Result

Result type

Status

Status type