1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
use crate::QueryIds;
use crate::SelectKeysQuery;

/// Select keys builder.
pub struct SelectKeys(pub SelectKeysQuery);

/// Final builder that lets you create
/// an actual query object.
pub struct SelectKeysIds(pub SelectKeysQuery);

impl SelectKeys {
    /// An id or list of ids or search query to select keys of.
    /// All ids specified must exist in the database.
    pub fn ids<T: Into<QueryIds>>(mut self, ids: T) -> SelectKeysIds {
        self.0 .0 = ids.into();

        SelectKeysIds(self.0)
    }
}

impl SelectKeysIds {
    /// Returns the built `SelectKeysQuery` object.
    pub fn query(self) -> SelectKeysQuery {
        self.0
    }
}