pub struct RepositoryOptions {
pub app_root: PathBuf,
pub user_agent: String,
pub source_mode: SourceMode,
pub pre_indexed_source_auto_update_interval: Option<Duration>,
pub install_progress: Option<fn(&InstallProgress)>,
}Expand description
Options for embedding the WinGet core library in another application.
Fields§
§app_root: PathBuf§user_agent: String§source_mode: SourceMode§pre_indexed_source_auto_update_interval: Option<Duration>§install_progress: Option<fn(&InstallProgress)>Implementations§
Source§impl RepositoryOptions
impl RepositoryOptions
Sourcepub fn new(app_root: impl Into<PathBuf>) -> Self
pub fn new(app_root: impl Into<PathBuf>) -> Self
Creates library options that keep all persistent state under the supplied root.
Sourcepub fn for_current_user() -> Result<Self>
pub fn for_current_user() -> Result<Self>
Uses the default per-user app-data root that the CLI also uses.
Sourcepub fn with_user_agent(self, user_agent: impl Into<String>) -> Self
pub fn with_user_agent(self, user_agent: impl Into<String>) -> Self
Overrides the HTTP user-agent sent to source endpoints.
pub fn with_source_mode(self, source_mode: SourceMode) -> Self
Sourcepub fn with_pre_indexed_source_auto_update_interval(
self,
interval: Option<Duration>,
) -> Self
pub fn with_pre_indexed_source_auto_update_interval( self, interval: Option<Duration>, ) -> Self
Overrides automatic freshness checks for existing pre-indexed source indexes.
Sourcepub fn with_install_progress(self, progress: fn(&InstallProgress)) -> Self
pub fn with_install_progress(self, progress: fn(&InstallProgress)) -> Self
Receives coarse install/update phase notifications. Intended for CLIs and host applications that need to show progress while downloads or silent installers are running.
Trait Implementations§
Source§impl Clone for RepositoryOptions
impl Clone for RepositoryOptions
Source§fn clone(&self) -> RepositoryOptions
fn clone(&self) -> RepositoryOptions
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for RepositoryOptions
impl RefUnwindSafe for RepositoryOptions
impl Send for RepositoryOptions
impl Sync for RepositoryOptions
impl Unpin for RepositoryOptions
impl UnsafeUnpin for RepositoryOptions
impl UnwindSafe for RepositoryOptions
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<K, Q> Comparable<Q> for K
impl<K, Q> Comparable<Q> for K
Source§impl<K, Q> Equivalent<Q> for K
impl<K, Q> Equivalent<Q> for K
Source§fn equivalent(&self, key: &Q) -> bool
fn equivalent(&self, key: &Q) -> bool
Compare self to
key and return true if they are equal.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