pub struct MultiQueryDatabase<'a, Querier> { /* private fields */ }Expand description
Database to lookup queriers from their package names and repositories.
This type of database is designed for repository-aware use cases. For example: Multiple repositories whose packages may have duplicated names.
Implementations§
Source§impl<'a, Querier: ShouldReuse> MultiQueryDatabase<'a, Querier>
impl<'a, Querier: ShouldReuse> MultiQueryDatabase<'a, Querier>
Sourcepub fn extend<PairIter>(
&mut self,
pairs: PairIter,
) -> Result<(), InsertError<'_>>
pub fn extend<PairIter>( &mut self, pairs: PairIter, ) -> Result<(), InsertError<'_>>
Extend the database with an iterator of tuples of a RepositoryName and an immutable querier
of a desc file.
Old queriers which occupied the same pair of repository and name would be replaced.
Sourcepub fn extend_mut<PairIter>(
&mut self,
pairs: PairIter,
) -> Result<(), InsertError<'_>>
pub fn extend_mut<PairIter>( &mut self, pairs: PairIter, ) -> Result<(), InsertError<'_>>
Extend the database with an iterator of tuples of a RepositoryName and a mutable querier
of a desc file.
Old queriers which occupied the same pair of repository and name would be replaced.
Sourcepub fn extend_newer<PairIter>(
&mut self,
pairs: PairIter,
) -> Result<(), InsertError<'_>>
pub fn extend_newer<PairIter>( &mut self, pairs: PairIter, ) -> Result<(), InsertError<'_>>
Extend the database with an iterator of tuples of a RepositoryName and an immutable querier
of a desc file.
An item from the iterator would replace an existing entry which occupied the same pair of repository and name if the iterator’s item has newer version than that of the existing entry.
Sourcepub fn extend_newer_mut<PairIter>(
&mut self,
pairs: PairIter,
) -> Result<(), InsertError<'_>>
pub fn extend_newer_mut<PairIter>( &mut self, pairs: PairIter, ) -> Result<(), InsertError<'_>>
Extend the database with an iterator of tuples of a RepositoryName and a mutable querier
of a desc file.
An item from the iterator would replace an existing entry which occupied the same pair of repository and name if the iterator’s item has newer version than that of the existing entry.
Source§impl<'a, Querier> MultiQueryDatabase<'a, Querier>
impl<'a, Querier> MultiQueryDatabase<'a, Querier>
Sourcepub fn get(&self, name: Name<'_>) -> Option<&MultiQuerier<'a, Querier>>
pub fn get(&self, name: Name<'_>) -> Option<&MultiQuerier<'a, Querier>>
Get an immutable reference to a set of queriers of packages from different repositories by package name.
Sourcepub fn get_mut(
&mut self,
name: Name<'_>,
) -> Option<&mut MultiQuerier<'a, Querier>>
pub fn get_mut( &mut self, name: Name<'_>, ) -> Option<&mut MultiQuerier<'a, Querier>>
Get a mutable reference to a set of queriers of packages from different repositories by package name.
Source§impl<'a, Querier: ShouldReuse> MultiQueryDatabase<'a, Querier>
impl<'a, Querier: ShouldReuse> MultiQueryDatabase<'a, Querier>
Sourcepub fn insert(
&mut self,
repository: RepositoryName<'a>,
querier: Querier,
) -> Result<Option<Attached<Querier, ParsedVersion<'a>>>, InsertError<'a>>where
Querier: Query<'a>,
pub fn insert(
&mut self,
repository: RepositoryName<'a>,
querier: Querier,
) -> Result<Option<Attached<Querier, ParsedVersion<'a>>>, InsertError<'a>>where
Querier: Query<'a>,
Add an immutable querier of a desc file to the database.
If an older querier already occupied the same pair of name and repository, it will be returned inside Ok(Some(_)).
Sourcepub fn insert_mut(
&mut self,
repository: RepositoryName<'a>,
querier: Querier,
) -> Result<Option<Attached<Querier, ParsedVersion<'a>>>, InsertError<'a>>where
Querier: QueryMut<'a>,
pub fn insert_mut(
&mut self,
repository: RepositoryName<'a>,
querier: Querier,
) -> Result<Option<Attached<Querier, ParsedVersion<'a>>>, InsertError<'a>>where
Querier: QueryMut<'a>,
Add a mutable querier of a desc file to the database.
If an older querier already occupied the same pair of name and repository, it will be returned inside Ok(Some(_)).
Source§impl<'a, Querier: ShouldReuse> MultiQueryDatabase<'a, Querier>
impl<'a, Querier: ShouldReuse> MultiQueryDatabase<'a, Querier>
Sourcepub fn insert_newer(
&mut self,
repository: RepositoryName<'a>,
querier: Querier,
) -> Result<InsertNewerReturn<'a, Querier>, InsertError<'a>>where
Querier: Query<'a>,
pub fn insert_newer(
&mut self,
repository: RepositoryName<'a>,
querier: Querier,
) -> Result<InsertNewerReturn<'a, Querier>, InsertError<'a>>where
Querier: Query<'a>,
Add an immutable querier of a desc file to the database unless the entry was already occupied by a querier whose
package version is not older than the provided querier.
Sourcepub fn insert_newer_mut(
&mut self,
repository: RepositoryName<'a>,
querier: Querier,
) -> Result<InsertNewerReturn<'a, Querier>, InsertError<'a>>where
Querier: QueryMut<'a>,
pub fn insert_newer_mut(
&mut self,
repository: RepositoryName<'a>,
querier: Querier,
) -> Result<InsertNewerReturn<'a, Querier>, InsertError<'a>>where
Querier: QueryMut<'a>,
Add a mutable querier of a desc file to the database unless the entry was already occupied by a querier whose
package version is not older than the provided querier.
Source§impl<'a, Querier> MultiQueryDatabase<'a, Querier>
impl<'a, Querier> MultiQueryDatabase<'a, Querier>
Sourcepub fn entries(&self) -> MultiEntries<'_, 'a, Querier> ⓘ
pub fn entries(&self) -> MultiEntries<'_, 'a, Querier> ⓘ
Get an iterator over all pairs of package names and immutable queriers.
Sourcepub fn entries_mut(&mut self) -> MultiEntriesMut<'_, 'a, Querier> ⓘ
pub fn entries_mut(&mut self) -> MultiEntriesMut<'_, 'a, Querier> ⓘ
Get an iterator over all pairs of package names and mutable queriers.
Sourcepub fn latest_entries(&self) -> LatestEntries<'_, 'a, Querier> ⓘ
pub fn latest_entries(&self) -> LatestEntries<'_, 'a, Querier> ⓘ
Get an iterator over all pairs of package names and immutable queriers of the latest versions of each package.
Sourcepub fn latest_entries_mut(&mut self) -> LatestEntriesMut<'_, 'a, Querier> ⓘ
pub fn latest_entries_mut(&mut self) -> LatestEntriesMut<'_, 'a, Querier> ⓘ
Get an iterator over all pairs of package names and mutable queriers of the latest versions of each package.
Source§impl<'a, Querier: ShouldReuse> MultiQueryDatabase<'a, Querier>
impl<'a, Querier: ShouldReuse> MultiQueryDatabase<'a, Querier>
Sourcepub fn from_queriers<PairIter>(pairs: PairIter) -> Result<Self, InsertError<'a>>
pub fn from_queriers<PairIter>(pairs: PairIter) -> Result<Self, InsertError<'a>>
Construct a database with an iterator of tuples of a RepositoryName and an immutable querier
of a desc file.
If there are collisions between pairs of repository and name, the later pair would override the earlier.
Sourcepub fn from_queriers_mut<PairIter>(
pairs: PairIter,
) -> Result<Self, InsertError<'a>>
pub fn from_queriers_mut<PairIter>( pairs: PairIter, ) -> Result<Self, InsertError<'a>>
Construct a database with an iterator of tuples of a RepositoryName and a mutable querier
of a desc file.
If there are collisions between pairs of repository and name, the later pair would override the earlier.
Sourcepub fn from_newer_queriers<PairIter>(
pairs: PairIter,
) -> Result<Self, InsertError<'a>>
pub fn from_newer_queriers<PairIter>( pairs: PairIter, ) -> Result<Self, InsertError<'a>>
Construct a database with an iterator of tuples of a RepositoryName and an immutable querier
of a desc file.
If there are collisions between pairs of repository and name, the one with newer package version would override the older.
Sourcepub fn from_newer_queriers_mut<PairIter>(
pairs: PairIter,
) -> Result<Self, InsertError<'a>>
pub fn from_newer_queriers_mut<PairIter>( pairs: PairIter, ) -> Result<Self, InsertError<'a>>
Construct a database with an iterator of tuples of a RepositoryName and a mutable querier
of a desc file.
If there are collisions between pairs of repository and name, the one with newer package version would override the older.
Source§impl<'a, Querier> MultiQueryDatabase<'a, Querier>
impl<'a, Querier> MultiQueryDatabase<'a, Querier>
Sourcepub fn names(&self) -> Names<'_, 'a, Querier> ⓘ
pub fn names(&self) -> Names<'_, 'a, Querier> ⓘ
Get an iterator over all package names.
Source§impl<'a, Querier> MultiQueryDatabase<'a, Querier>
impl<'a, Querier> MultiQueryDatabase<'a, Querier>
Sourcepub fn queriers(&self) -> MultiQueriers<'_, 'a, Querier> ⓘ
pub fn queriers(&self) -> MultiQueriers<'_, 'a, Querier> ⓘ
Get an iterator over all immutable queriers.
Sourcepub fn queriers_mut(&mut self) -> MultiQueriersMut<'_, 'a, Querier> ⓘ
pub fn queriers_mut(&mut self) -> MultiQueriersMut<'_, 'a, Querier> ⓘ
Get an iterator over all mutable queriers.
Sourcepub fn latest_queriers(&self) -> LatestQueriers<'_, 'a, Querier> ⓘ
pub fn latest_queriers(&self) -> LatestQueriers<'_, 'a, Querier> ⓘ
Get an iterator over all immutable queriers of the latest versions of each package.
Sourcepub fn latest_queriers_mut(&mut self) -> LatestQueriersMut<'_, 'a, Querier> ⓘ
pub fn latest_queriers_mut(&mut self) -> LatestQueriersMut<'_, 'a, Querier> ⓘ
Get an iterator over all mutable queriers of the latest versions of each package.
Source§impl<Querier> MultiQueryDatabase<'_, Querier>
impl<Querier> MultiQueryDatabase<'_, Querier>
Sourcepub fn latest(&self) -> MultiQueryDatabaseLatest<&Self>
pub fn latest(&self) -> MultiQueryDatabaseLatest<&Self>
Combine the different repositories into a database view of immutable queriers that lookup the latest versions of packages.
Sourcepub fn latest_mut(&mut self) -> MultiQueryDatabaseLatest<&mut Self>
pub fn latest_mut(&mut self) -> MultiQueryDatabaseLatest<&mut Self>
Combine the different repositories into a database view of mutable queriers that lookup the latest versions of packages.
Source§impl<Querier> MultiQueryDatabase<'_, Querier>
impl<Querier> MultiQueryDatabase<'_, Querier>
Source§impl<Querier> MultiQueryDatabase<'_, Querier>
impl<Querier> MultiQueryDatabase<'_, Querier>
Sourcepub fn with_capacity(capacity: usize) -> Self
pub fn with_capacity(capacity: usize) -> Self
Create an empty database with at least the specified capacity.
Source§impl<'query, Querier> MultiQueryDatabase<'query, Querier>
impl<'query, Querier> MultiQueryDatabase<'query, Querier>
Sourcepub fn alternative_providers<'r, 'name>(
&'r self,
target: DependencyName<'name>,
) -> AlternativeProviders<'r, 'query, 'name, Querier> ⓘ
pub fn alternative_providers<'r, 'name>( &'r self, target: DependencyName<'name>, ) -> AlternativeProviders<'r, 'query, 'name, Querier> ⓘ
Get an iterator over all immutable queriers of packages which list a certain DependencyName in their
provides array.
This method is prefixed with “alternative” because a package doesn’t usually list itself in its own provides,
and consequently, would usually be excluded from this iterator. Beware that if it does list itself, its own
name would be included.
Sourcepub fn alternative_providers_mut<'r, 'name>(
&'r mut self,
target: DependencyName<'name>,
) -> AlternativeProvidersMut<'r, 'query, 'name, Querier> ⓘ
pub fn alternative_providers_mut<'r, 'name>( &'r mut self, target: DependencyName<'name>, ) -> AlternativeProvidersMut<'r, 'query, 'name, Querier> ⓘ
Get an iterator over all mutable queriers of packages which list a certain DependencyName in their
provides array.
This method is prefixed with “alternative” because a package doesn’t usually list itself in its own provides,
and consequently, would usually be excluded from this iterator. Beware that if it does list itself, its own
name would be included.
Trait Implementations§
Source§impl<'a, Querier: Clone> Clone for MultiQueryDatabase<'a, Querier>
impl<'a, Querier: Clone> Clone for MultiQueryDatabase<'a, Querier>
Source§fn clone(&self) -> MultiQueryDatabase<'a, Querier>
fn clone(&self) -> MultiQueryDatabase<'a, Querier>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl<'a, Querier: Debug> Debug for MultiQueryDatabase<'a, Querier>
impl<'a, Querier: Debug> Debug for MultiQueryDatabase<'a, Querier>
Source§impl<Querier> Default for MultiQueryDatabase<'_, Querier>
impl<Querier> Default for MultiQueryDatabase<'_, Querier>
Source§impl<'a, Querier> IntoIterator for MultiQueryDatabase<'a, Querier>
impl<'a, Querier> IntoIterator for MultiQueryDatabase<'a, Querier>
Auto Trait Implementations§
impl<'a, Querier> Freeze for MultiQueryDatabase<'a, Querier>
impl<'a, Querier> RefUnwindSafe for MultiQueryDatabase<'a, Querier>where
Querier: RefUnwindSafe,
impl<'a, Querier> Send for MultiQueryDatabase<'a, Querier>where
Querier: Send,
impl<'a, Querier> Sync for MultiQueryDatabase<'a, Querier>where
Querier: Sync,
impl<'a, Querier> Unpin for MultiQueryDatabase<'a, Querier>where
Querier: Unpin,
impl<'a, Querier> UnwindSafe for MultiQueryDatabase<'a, Querier>where
Querier: UnwindSafe,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Main> IntoAttached for Main
impl<Main> IntoAttached for Main
Source§fn into_attached<Attachment>(
self,
attachment: Attachment,
) -> Attached<Self, Attachment>
fn into_attached<Attachment>( self, attachment: Attachment, ) -> Attached<Self, Attachment>
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 moreSource§impl<T> Is for T
impl<T> Is for T
type Type = T
fn into_val(self) -> <T as Is>::Type
fn into_ref(&self) -> &<T as Is>::Type
fn into_mut_ref(&mut self) -> &mut <T as Is>::Type
fn from_val(x: <T as Is>::Type) -> T
fn from_ref(x: &<T as Is>::Type) -> &T
fn from_mut_ref(x: &mut <T as Is>::Type) -> &mut T
Source§impl<X> Pipe for X
impl<X> Pipe for X
Source§fn pipe_ref<'a, Return, Function>(&'a self, f: Function) -> Returnwhere
Function: FnOnce(&'a Self) -> Return,
fn pipe_ref<'a, Return, Function>(&'a self, f: Function) -> Returnwhere
Function: FnOnce(&'a Self) -> Return,
Source§fn pipe_mut<'a, Return, Function>(&'a mut self, f: Function) -> Returnwhere
Function: FnOnce(&'a mut Self) -> Return,
fn pipe_mut<'a, Return, Function>(&'a mut self, f: Function) -> Returnwhere
Function: FnOnce(&'a mut Self) -> Return,
Source§fn pipe_as_ref<'a, Param, Return, Function>(&'a self, f: Function) -> Return
fn pipe_as_ref<'a, Param, Return, Function>(&'a self, f: Function) -> Return
f to &self where f takes a single parameter of type Param
and Self implements trait AsRef<Param>. Read moreSource§fn pipe_as_mut<'a, Param, Return, Function>(&'a mut self, f: Function) -> Return
fn pipe_as_mut<'a, Param, Return, Function>(&'a mut self, f: Function) -> Return
f to &mut self where f takes a single parameter of type Param
and Self implements trait AsMut<Param>. Read moreSource§fn pipe_deref<'a, Param, Return, Function>(&'a self, f: Function) -> Return
fn pipe_deref<'a, Param, Return, Function>(&'a self, f: Function) -> Return
f to &self where f takes a single parameter of type Param
and Self implements trait Deref<Target = Param>. Read moreSource§fn pipe_deref_mut<'a, Param, Return, Function>(
&'a mut self,
f: Function,
) -> Returnwhere
Self: DerefMut<Target = Param>,
Param: 'a + ?Sized,
Function: FnOnce(&'a mut Param) -> Return,
fn pipe_deref_mut<'a, Param, Return, Function>(
&'a mut self,
f: Function,
) -> Returnwhere
Self: DerefMut<Target = Param>,
Param: 'a + ?Sized,
Function: FnOnce(&'a mut Param) -> Return,
f to &mut self where f takes a single parameter of type Param
and Self implements trait DerefMut<Target = Param>. Read moreSource§fn pipe_borrow<'a, Param, Return, Function>(&'a self, f: Function) -> Return
fn pipe_borrow<'a, Param, Return, Function>(&'a self, f: Function) -> Return
f to &self where f takes a single parameter of type Param
and Self implements trait Borrow<Param>. Read moreSource§fn pipe_borrow_mut<'a, Param, Return, Function>(
&'a mut self,
f: Function,
) -> Return
fn pipe_borrow_mut<'a, Param, Return, Function>( &'a mut self, f: Function, ) -> Return
f to &mut self where f takes a single parameter of type Param
and Self implements trait BorrowMut<Param>. Read more