pub struct PackageIndex { /* private fields */ }Expand description
Parsed package index for one repository host across multiple dists.
Implementations§
Source§impl PackageIndex
impl PackageIndex
Sourcepub fn new(
host: Url,
packages: IndexMap<String, IndexMap<String, UbuntuRepositoryEntry>>,
) -> Self
pub fn new( host: Url, packages: IndexMap<String, IndexMap<String, UbuntuRepositoryEntry>>, ) -> Self
Creates a new PackageIndex.
Sourcepub fn find(
&self,
query: &PackageQuery,
) -> Result<Option<&UbuntuRepositoryEntry>, UbuntuError>
pub fn find( &self, query: &PackageQuery, ) -> Result<Option<&UbuntuRepositoryEntry>, UbuntuError>
Looks up a package matching the query across all dists.
Returns the matching entry. Errors with PackageMultipleCandidates if
more than one dist contains a matching entry.
Sourcepub fn resolve_url(
&self,
entry: &UbuntuRepositoryEntry,
) -> Result<Url, UbuntuError>
pub fn resolve_url( &self, entry: &UbuntuRepositoryEntry, ) -> Result<Url, UbuntuError>
Resolves a package entry to its full download URL via this index’s host.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for PackageIndex
impl RefUnwindSafe for PackageIndex
impl Send for PackageIndex
impl Sync for PackageIndex
impl Unpin for PackageIndex
impl UnsafeUnpin for PackageIndex
impl UnwindSafe for PackageIndex
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