Struct archlinux_repo::Repository[][src]

pub struct Repository { /* fields omitted */ }
Expand description

Arch Linux repository

Implementations

Loads arch repository by it’s name and url

Example

use archlinux_repo::Repository;

let repo = Repository::load("mingw64", "http://repo.msys2.org/mingw/x86_64").await?;

Get package by full name. Will return None if package cannot be found

Example

use archlinux_repo::Repository;

let repo = Repository::load("mingw64", "http://repo.msys2.org/mingw/x86_64").await?;
let gtk = repo.get_package_by_name("mingw-w64-x86_64-gtk3")?;

Get package by full name and version. Will return None if package cannot be found

Example

use archlinux_repo::Repository;

let repo = Repository::load("mingw64", "http://repo.msys2.org/mingw/x86_64").await?;
let gtk = repo.get_package_by_name_and_version("mingw-w64-x86_64-gtk3-3.24.9-4")?;

Get package by base name. Will return None if package cannot be found

NOTE! Not all packages have names

Example

use archlinux_repo::Repository;

let repo = Repository::load("mingw64", "http://repo.msys2.org/mingw/x86_64").await?;
let gtk = repo.get_package_by_base("mingw-w64-gtk3")?;

Get package files by full name. Will return None if package cannot be found or does not contains file metadata

NOTE! This method will always return None if load_files_meta is false NOTE! For CSV packages base package name will always return None unless it exists in repo

Example

use archlinux_repo::{Repository, RepositoryBuilder};

let repo = RepositoryBuilder::new("mingw64", "http://repo.msys2.org/mingw/x86_64")
                .files_metadata(true)
                .load()
                .await?;
let gtk_files = repo.get_package_files("mingw-w64-x86_64-gtk3")?;

Send HTTP request to download package by full name/base name or name with version. Panics if package not found

Example

use archlinux_repo::Repository;

let repo = Repository::load("mingw64", "http://repo.msys2.org/mingw/x86_64").await?;
let gtk_package = repo.request_package("mingw-w64-gtk3").await?.bytes().await?;

Reload repository

Trait Implementations

The returned type after indexing.

Performs the indexing (container[index]) operation. Read more

The type of the elements being iterated over.

Which kind of iterator are we turning this into?

Creates an iterator from a value. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.