Crate zip_downloader

Source
Expand description

§Overview

A simple Rust crate for one-line download and read of ZIP files. providing the content as a String or as bytes.

This library features:

  • Download ZIP files from a specified URL
  • Validate that the URL points to a ZIP archive
  • Unpack ZIP files into an allocated buffer
  • Retrieve file content as a String
  • Retrieve file content as bytes
  • Access a specific line of text from the file

§Usage

use zip_downloader::ZipDownloader;

let url = "https://github.com/zartarn15/zip_downloader/raw/refs/heads/master/tests/data/text.zip";

// Download and get ZIP file as String
let string = ZipDownloader::get(url).unwrap().text().unwrap();

// Download and get ZIP file as bytes
let bytes = ZipDownloader::get(url).unwrap().bytes();

// Download and get 3rd line from ZIP-packed text
let line = ZipDownloader::get(url).unwrap().line(3).unwrap();

// Download and get 3rd byte from ZIP packed byte file
let byte = ZipDownloader::get(url).unwrap().bytes()[3];

Structs§

ZipDownloader
Main crate structure

Enums§

Error
ZIP downloading and unpacking errors