Struct wac_resolver::RegistryPackageResolver
source · pub struct RegistryPackageResolver { /* private fields */ }Expand description
Used to resolve packages from a Warg registry.
Note that the registry will be locked for the lifetime of the resolver.
Implementations§
source§impl RegistryPackageResolver
impl RegistryPackageResolver
sourcepub async fn new(
url: Option<&str>,
bar: Option<Box<dyn ProgressBar>>,
) -> Result<Self>
pub async fn new( url: Option<&str>, bar: Option<Box<dyn ProgressBar>>, ) -> Result<Self>
Creates a new registry package resolver using the default client configuration file.
If url is None, the default URL will be used.
sourcepub async fn new_with_config(
url: Option<&str>,
config: &Config,
bar: Option<Box<dyn ProgressBar>>,
) -> Result<Self>
pub async fn new_with_config( url: Option<&str>, config: &Config, bar: Option<Box<dyn ProgressBar>>, ) -> Result<Self>
Creates a new registry package resolver with the given configuration.
If url is None, the default URL will be used.
sourcepub async fn resolve<'a>(
&self,
keys: &IndexMap<BorrowedPackageKey<'a>, SourceSpan>,
) -> Result<IndexMap<BorrowedPackageKey<'a>, Vec<u8>>, Error>
pub async fn resolve<'a>( &self, keys: &IndexMap<BorrowedPackageKey<'a>, SourceSpan>, ) -> Result<IndexMap<BorrowedPackageKey<'a>, Vec<u8>>, Error>
Resolves the provided package keys to packages.
If the package isn’t found, an error is returned.
Auto Trait Implementations§
impl Freeze for RegistryPackageResolver
impl !RefUnwindSafe for RegistryPackageResolver
impl !Send for RegistryPackageResolver
impl !Sync for RegistryPackageResolver
impl Unpin for RegistryPackageResolver
impl !UnwindSafe for RegistryPackageResolver
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
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