pub struct Repository { /* private fields */ }
Expand description
Arch Linux repository
Implementations§
Source§impl Repository
impl Repository
Sourcepub fn get_package_by_name(&self, name: &str) -> Option<&Package>
pub fn get_package_by_name(&self, name: &str) -> Option<&Package>
Sourcepub fn get_package_by_name_and_version(&self, name: &str) -> Option<&Package>
pub fn get_package_by_name_and_version(&self, name: &str) -> Option<&Package>
Sourcepub fn get_package_by_base(&self, name: &str) -> Option<&Package>
pub fn get_package_by_base(&self, name: &str) -> Option<&Package>
Sourcepub fn get_package_files(&self, name: &str) -> Option<&Vec<String>>
pub fn get_package_files(&self, name: &str) -> Option<&Vec<String>>
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")?;
Sourcepub async fn request_package(
&self,
name: &str,
) -> Result<Response, Box<dyn Error>>
pub async fn request_package( &self, name: &str, ) -> Result<Response, Box<dyn Error>>
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?;
Trait Implementations§
Source§impl Index<&str> for Repository
impl Index<&str> for Repository
Source§impl<'a> IntoIterator for &'a Repository
impl<'a> IntoIterator for &'a Repository
Source§type IntoIter = Box<dyn Iterator<Item = <&'a Repository as IntoIterator>::Item> + 'a>
type IntoIter = Box<dyn Iterator<Item = <&'a Repository as IntoIterator>::Item> + 'a>
Which kind of iterator are we turning this into?
Auto Trait Implementations§
impl Freeze for Repository
impl !RefUnwindSafe for Repository
impl !Send for Repository
impl !Sync for Repository
impl Unpin for Repository
impl !UnwindSafe for Repository
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more