arch_pkg_db/single/new.rs
1use super::QueryDatabase;
2use std::collections::HashMap;
3
4impl<Querier> QueryDatabase<'_, Querier> {
5 /// Create an empty database.
6 pub fn new() -> Self {
7 QueryDatabase {
8 internal: HashMap::new(),
9 }
10 }
11
12 /// Create an empty database with at least the specified capacity.
13 pub fn with_capacity(capacity: usize) -> Self {
14 QueryDatabase {
15 internal: HashMap::with_capacity(capacity),
16 }
17 }
18}
19
20impl<Querier> Default for QueryDatabase<'_, Querier> {
21 fn default() -> Self {
22 Self::new()
23 }
24}