Skip to main content

Backend

Trait Backend 

Source
pub trait Backend {
    // Required methods
    fn install(&mut self, package: RemotePackage) -> Result<(), Error>;
    fn uninstall(&mut self, package: PackageName) -> Result<(), Error>;
    fn upgrade(&mut self, package: &RemotePackage) -> Result<(), Error>;
    fn get_package_detail(
        &self,
        package: &PackageName,
    ) -> Result<RemotePackage, Error>;
    fn get_repository_detail(&self) -> Result<Repository, Error>;
    fn get_package_state(&self) -> PackageState;
    fn commit_check_conflict(&self) -> Result<&Vec<TransactionConflict>, Error>;
    fn commit_state(&mut self, new_state: PackageState) -> Result<usize, Error>;
    fn abort_state(&mut self) -> Result<usize, Error>;
}

Required Methods§

Source

fn install(&mut self, package: RemotePackage) -> Result<(), Error>

individually install a package

Source

fn uninstall(&mut self, package: PackageName) -> Result<(), Error>

individually uninstall a package

Source

fn upgrade(&mut self, package: &RemotePackage) -> Result<(), Error>

individually upgrade a package

Source

fn get_package_detail( &self, package: &PackageName, ) -> Result<RemotePackage, Error>

download package TOML data

Source

fn get_repository_detail(&self) -> Result<Repository, Error>

download repo TOML data

Source

fn get_package_state(&self) -> PackageState

get state of current installation

Source

fn commit_check_conflict(&self) -> Result<&Vec<TransactionConflict>, Error>

check if there’s pending transaction conflicts before committing

Source

fn commit_state(&mut self, new_state: PackageState) -> Result<usize, Error>

commit all pending changes, and set state of current installation

Source

fn abort_state(&mut self) -> Result<usize, Error>

abort all pending changes

Implementors§