[][src]Trait raur::Raur

pub trait Raur {
    type Err;
    fn info<S: AsRef<str>>(
        &self,
        pkg_names: &[S]
    ) -> Result<Vec<Package>, Self::Err>;
fn search_by<S: AsRef<str>>(
        &self,
        query: S,
        strategy: SearchBy
    ) -> Result<Vec<Package>, Self::Err>; fn search<S: AsRef<str>>(&self, query: S) -> Result<Vec<Package>, Self::Err> { ... }
fn orphans(&self) -> Result<Vec<Package>, Self::Err> { ... } }

The trait for RPC functionality.

Handle Implements this and can be used directly in user code. However is may be useful to be Generic over this trait to allow for testing using mock implementors.

Associated Types

type Err

The error type that functions may return.

Loading content...

Required methods

fn info<S: AsRef<str>>(
    &self,
    pkg_names: &[S]
) -> Result<Vec<Package>, Self::Err>

Performs an AUR info request.

This function sends an info request to the AUR RPC. This kind of request takes a list of package names and returns a list of AUR Packages who's name exactly matches the input.

Note: If a package being queried does not exist then it will be silently ignored and not appear in return value.

Note: The return value has no guaranteed order.

fn search_by<S: AsRef<str>>(
    &self,
    query: S,
    strategy: SearchBy
) -> Result<Vec<Package>, Self::Err>

Performs an AUR search request.

This function sends a search request to the AUR RPC. This kind of request takes a single query and returns a list of matching packages.

Note: Unlike info, search results will never inclide:

  • Dependency types
  • Licence
  • Groups

See SearchBy for how packages are matched.

Loading content...

Provided methods

fn search<S: AsRef<str>>(&self, query: S) -> Result<Vec<Package>, Self::Err>

Performs an AUR search request by NameDesc.

This is the same as fn.search_by except it always searches by NameDesc (the default for the AUR).

fn orphans(&self) -> Result<Vec<Package>, Self::Err>

Returns a list of all orphan packages in the AUR.

Loading content...

Implementors

impl Raur for Handle[src]

type Err = Error

Loading content...