alpm 4.0.2

Rust bindings for libalpm
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use crate::{Alpm, AlpmListMut, AsAlpmList, Result};

use alpm_sys::*;

use std::ptr;

impl Alpm {
    pub fn fetch_pkgurl<'a, L: AsAlpmList<&'a str>>(&self, urls: L) -> Result<AlpmListMut<String>> {
        urls.with(|url| {
            let mut out = ptr::null_mut();
            let ret = unsafe { alpm_fetch_pkgurl(self.as_ptr(), url.as_ptr(), &mut out) };
            self.check_ret(ret)?;
            let fetched = unsafe { AlpmListMut::from_ptr(out) };
            Ok(fetched)
        })
    }
}