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 moreSource§impl Debug for NassunOpts
impl Debug for NassunOpts
Source§impl Default for NassunOpts
impl Default for NassunOpts
Source§fn default() -> NassunOpts
fn default() -> NassunOpts
Auto Trait Implementations§
impl !Freeze for NassunOpts
impl !RefUnwindSafe for NassunOpts
impl Send for NassunOpts
impl Sync for NassunOpts
impl Unpin for NassunOpts
impl !UnwindSafe for NassunOpts
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<F, W, T, D> Deserialize<With<T, W>, D> for F
impl<F, W, T, D> Deserialize<With<T, W>, D> for F
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>
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>
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