pub struct Repository { /* private fields */ }Implementations§
Source§impl Repository
impl Repository
Sourcepub fn open() -> Result<Self>
pub fn open() -> Result<Self>
Opens the repository with the default per-user CLI storage layout.
Sourcepub fn open_with_options(options: RepositoryOptions) -> Result<Self>
pub fn open_with_options(options: RepositoryOptions) -> Result<Self>
Opens the repository with explicit hosting options for library consumers.
pub fn app_root(&self) -> &Path
pub fn list_sources(&self) -> Vec<SourceRecord>
pub fn add_source( &mut self, name: &str, arg: &str, kind: SourceKind, ) -> Result<()>
pub fn add_source_with_metadata( &mut self, name: &str, arg: &str, kind: SourceKind, trust_level: Option<&str>, explicit: bool, priority: i32, ) -> Result<()>
pub fn edit_source( &mut self, name: &str, explicit: Option<bool>, trust_level: Option<&str>, ) -> Result<()>
pub fn remove_source(&mut self, name: &str) -> Result<()>
pub fn reset_source(&mut self, name: &str) -> Result<()>
pub fn reset_sources(&mut self) -> Result<()>
pub fn supported_admin_settings() -> &'static [&'static str]
pub fn get_user_settings(&self) -> Result<JsonValue>
pub fn set_user_settings( &self, user_settings: &JsonValue, merge: bool, ) -> Result<JsonValue>
pub fn test_user_settings( &self, expected: &JsonValue, ignore_not_set: bool, ) -> Result<bool>
pub fn get_admin_settings(&self) -> Result<JsonValue>
pub fn set_admin_setting(&self, name: &str, enabled: bool) -> Result<()>
pub fn reset_admin_setting( &self, name: Option<&str>, reset_all: bool, ) -> Result<()>
pub fn ensure_settings_files(&self) -> Result<()>
pub fn update_sources( &mut self, source_name: Option<&str>, ) -> Result<Vec<SourceUpdateResult>>
pub fn search(&mut self, query: &PackageQuery) -> Result<SearchResponse>
pub fn search_manifests( &mut self, query: &PackageQuery, ) -> Result<Vec<JsonValue>>
pub fn list(&mut self, query: &ListQuery) -> Result<ListResponse>
pub fn search_versions( &mut self, query: &PackageQuery, ) -> Result<VersionsResult>
pub fn show_versions(&mut self, query: &PackageQuery) -> Result<VersionsResult>
pub fn show(&mut self, query: &PackageQuery) -> Result<ShowResult>
pub fn warm_cache(&mut self, query: &PackageQuery) -> Result<CacheWarmResult>
pub fn list_pins(&self, source_id: Option<&str>) -> Result<Vec<PinRecord>>
pub fn add_pin( &self, package_id: &str, version: &str, source_id: &str, pin_type: PinType, ) -> Result<()>
pub fn remove_pin( &self, package_id: &str, source_id: Option<&str>, ) -> Result<bool>
pub fn reset_pins(&self, source_id: Option<&str>) -> Result<()>
pub fn download_installer( &mut self, query: &PackageQuery, download_dir: &Path, ) -> Result<DownloadOutput>
pub fn download_installer_for_request( &mut self, request: &InstallRequest, download_dir: &Path, ) -> Result<DownloadOutput>
pub fn install( &mut self, query: &PackageQuery, silent: bool, ) -> Result<InstallResult>
pub fn install_with_mode( &mut self, query: &PackageQuery, mode: InstallerMode, ) -> Result<InstallResult>
pub fn install_request( &mut self, request: &InstallRequest, ) -> Result<InstallResult>
pub fn repair(&mut self, request: &RepairRequest) -> Result<InstallResult>
pub fn uninstall( &mut self, query: &PackageQuery, silent: bool, ) -> Result<InstallResult>
pub fn uninstall_request( &mut self, request: &UninstallRequest, ) -> Result<InstallResult>
Auto Trait Implementations§
impl !RefUnwindSafe for Repository
impl !UnwindSafe for Repository
impl Freeze for Repository
impl Send for Repository
impl Sync for Repository
impl Unpin for Repository
impl UnsafeUnpin 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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more