[−][src]Struct aur_fetch::Handle
Handle to the current configuration.
This handle is used to configure parts of the fetching process. All the features of this crate must be done through this handle.
Fields
clone_dir: PathBuf
The directory to place AUR packages in.
diff_dir: PathBuf
The directory to place diffs in.
git: PathBuf
The git command to run.
aur_url: Url
The AUR URL.
Methods
impl Handle
[src]
pub fn new() -> Result<Self>
[src]
Create a new Handle with working defaults.
This Inializes the clone and diff dir to the current dirrectory. If you want to configure a cache directory you will need to do that yourself.
pub fn with_cache_dir<P: AsRef<Path>>(path: P) -> Result<Self>
[src]
Create a new handle with a specified cache dir.
clone_dir will be a subdirectory named clone inside of the specified path. diff_dir will be a subdirectory named diff inside of the specified path.
pub fn with_combined_cache_dir<P: AsRef<Path>>(path: P) -> Result<Self>
[src]
Create a new handle with a specified cache dir.
Both diffs and cloned packages will be places in the provided dir.
pub fn download<'a, S: AsRef<str>>(&self, pkgs: &'a [S]) -> Result<Vec<&'a str>>
[src]
Downloads a list of packages to the cache dir.
This downloads packages from the AUR using git. New packages will be cloned, while packages that already exist in cache will be fetched. Merging will need to be done in a separate step.
Each package is downloaded concurrently which givess a major speedup. No other functions are run concirrently as they will all complete pretty much isntantly.
Depending on how many packages are being downloaded and connection speed this
function may take a little while to complete. See download_cb
if
you wish track the progress of each download.
This also filters the input list to packages that were already in cache. This filtered list
can then be passed on to needs_merge
as freshly cloned packages will
not need to be merged.
pub fn download_cb<'a, S: AsRef<str>, F: Fn(Callback)>(
&self,
pkgs: &'a [S],
f: F
) -> Result<Vec<&'a str>>
[src]
&self,
pkgs: &'a [S],
f: F
) -> Result<Vec<&'a str>>
The same as download
but calls a Callback after each download.
The callback is called each time a package download is completed.
pub fn needs_merge<'a, S: AsRef<str>>(
&self,
pkgs: &'a [S]
) -> Result<Vec<&'a str>>
[src]
&self,
pkgs: &'a [S]
) -> Result<Vec<&'a str>>
Filters a list of packages, keeping ones that need to be merged.
Needing to be merged is defined as the current HEAD being different to the upstram HEAD.
pub fn diff<S: AsRef<str>>(
&self,
pkgs: &[S],
color: bool
) -> Result<Vec<String>>
[src]
&self,
pkgs: &[S],
color: bool
) -> Result<Vec<String>>
Diff a list of packages returning the diffs as strings.
Diffing a package that is already up to date will generate a diff against an empty git tree
Additionally this function gives you the ability to force color. This is useful if you intend to print the diffs to stdout.
pub fn save_diffs<S: AsRef<str>>(&self, pkgs: &[S]) -> Result<()>
[src]
Diff a list of packages and save them to diff_dir.
Diffing a package that is already up to date will generate a diff against an empty git tree
pub fn make_view<S1: AsRef<str>, S2: AsRef<str>>(
&self,
pkgs: &[S1],
diffs: &[S2]
) -> Result<TempDir>
[src]
&self,
pkgs: &[S1],
diffs: &[S2]
) -> Result<TempDir>
Makes a view of newly downloaded files.
This view is a tmp dir containing the packages downloaded/fetched and diffs for packages that have diffs.
Files are symlinked from the cache dirs so there is no duplication of files.
pub fn merge<S: AsRef<str>>(&self, pkgs: &[S]) -> Result<()>
[src]
Merge a list of packages with their upstream.
Trait Implementations
impl Clone for Handle
[src]
fn clone(&self) -> Handle
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl Debug for Handle
[src]
Auto Trait Implementations
impl Sync for Handle
impl Unpin for Handle
impl Send for Handle
impl UnwindSafe for Handle
impl RefUnwindSafe for Handle
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,