Struct node_maintainer::NassunOpts
source · pub struct NassunOpts { /* private fields */ }Expand description
Build a new Nassun instance with specified options.
Implementations§
source§impl NassunOpts
impl NassunOpts
pub fn new() -> NassunOpts
sourcepub fn client(self, client: OroClient) -> NassunOpts
pub fn client(self, client: OroClient) -> NassunOpts
A preconfigured [OroClient] to use for requests. Providing this will
override all other client-related options.
sourcepub fn cache(self, cache: impl AsRef<Path>) -> NassunOpts
pub fn cache(self, cache: impl AsRef<Path>) -> NassunOpts
Cache directory to use for requests.
sourcepub fn registry(self, registry: Url) -> NassunOpts
pub fn registry(self, registry: Url) -> NassunOpts
Sets the default registry for requests.
sourcepub fn scope_registry(self, scope: impl AsRef<str>, registry: Url) -> NassunOpts
pub fn scope_registry(self, scope: impl AsRef<str>, registry: Url) -> NassunOpts
Adds a registry to use for a specific scope.
sourcepub fn basic_auth(
self,
registry: Url,
username: impl AsRef<str>,
password: Option<impl AsRef<str>>
) -> NassunOpts
pub fn basic_auth( self, registry: Url, username: impl AsRef<str>, password: Option<impl AsRef<str>> ) -> NassunOpts
Sets basic auth credentials for a registry.
sourcepub fn token_auth(self, registry: Url, token: impl AsRef<str>) -> NassunOpts
pub fn token_auth(self, registry: Url, token: impl AsRef<str>) -> NassunOpts
Sets bearer token credentials for a registry.
sourcepub fn legacy_auth(
self,
registry: Url,
legacy_auth_token: impl AsRef<str>
) -> NassunOpts
pub fn legacy_auth( self, registry: Url, legacy_auth_token: impl AsRef<str> ) -> NassunOpts
Sets the legacy, pre-encoded auth token for a registry.
sourcepub fn base_dir(self, base_dir: impl AsRef<Path>) -> NassunOpts
pub fn base_dir(self, base_dir: impl AsRef<Path>) -> NassunOpts
Base directory to use for resolving relative paths. Defaults to ".".
sourcepub fn default_tag(self, default_tag: impl AsRef<str>) -> NassunOpts
pub fn default_tag(self, default_tag: impl AsRef<str>) -> NassunOpts
Default tag to use when resolving package versions. Defaults to latest.
sourcepub fn memoize_metadata(self, memoize: bool) -> NassunOpts
pub fn memoize_metadata(self, memoize: bool) -> NassunOpts
Whether to memoize package metadata. This will keep any processed
packuments in memory for the lifetime of this Nassun instance.
Setting this to true may increase performance when fetching many
packages, at the cost of significant additional memory usage.
sourcepub fn retries(self, retries: u32) -> NassunOpts
pub fn retries(self, retries: u32) -> NassunOpts
Number of times to retry failed requests.
sourcepub fn proxy(self, proxy: bool) -> NassunOpts
pub fn proxy(self, proxy: bool) -> NassunOpts
Whether to use a proxy for requests.
sourcepub fn proxy_url(
self,
proxy_url: impl AsRef<str>
) -> Result<NassunOpts, NassunError>
pub fn proxy_url( self, proxy_url: impl AsRef<str> ) -> Result<NassunOpts, NassunError>
Proxy URL to use for requests. If no_proxy_domain is needed, it must
be called before this method.
sourcepub fn no_proxy_domain(self, no_proxy_domain: impl AsRef<str>) -> NassunOpts
pub fn no_proxy_domain(self, no_proxy_domain: impl AsRef<str>) -> NassunOpts
Sets the NO_PROXY domain.
Trait Implementations§
source§impl Clone for NassunOpts
impl Clone for NassunOpts
source§fn clone(&self) -> NassunOpts
fn clone(&self) -> NassunOpts
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more