pub struct SearchQuery {
pub text: Option<String>,
pub algorithm: Option<KeyAlgorithm>,
pub purpose: Option<KeyPurpose>,
pub tags: Vec<String>,
pub created_after: Option<u64>,
pub created_before: Option<u64>,
}Expand description
Structured query against the KeySearchIndex.
Every field is optional; a None/empty field is treated as a wildcard
(i.e. it does not constrain the result set). When multiple fields are
populated they are combined as a logical AND — only keys satisfying every
constraint are returned.
Fields§
§text: Option<String>Free-form text matched as a case-insensitive substring against the key id and metadata fields (algorithm, key type, security level, …).
algorithm: Option<KeyAlgorithm>Exact algorithm filter.
purpose: Option<KeyPurpose>Exact purpose filter.
Tag filter — a key matches if it carries any of the listed tags.
created_after: Option<u64>Inclusive lower bound on the key creation timestamp.
created_before: Option<u64>Inclusive upper bound on the key creation timestamp.
Implementations§
Source§impl SearchQuery
impl SearchQuery
Sourcepub fn with_algorithm(self, algorithm: KeyAlgorithm) -> Self
pub fn with_algorithm(self, algorithm: KeyAlgorithm) -> Self
Set the algorithm filter.
Sourcepub fn with_purpose(self, purpose: KeyPurpose) -> Self
pub fn with_purpose(self, purpose: KeyPurpose) -> Self
Set the purpose filter.
Sourcepub fn with_created_after(self, ts: u64) -> Self
pub fn with_created_after(self, ts: u64) -> Self
Set the inclusive creation-date lower bound.
Sourcepub fn with_created_before(self, ts: u64) -> Self
pub fn with_created_before(self, ts: u64) -> Self
Set the inclusive creation-date upper bound.
Trait Implementations§
Source§impl Clone for SearchQuery
impl Clone for SearchQuery
Source§fn clone(&self) -> SearchQuery
fn clone(&self) -> SearchQuery
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for SearchQuery
impl Debug for SearchQuery
Source§impl Default for SearchQuery
impl Default for SearchQuery
Source§fn default() -> SearchQuery
fn default() -> SearchQuery
Auto Trait Implementations§
impl Freeze for SearchQuery
impl RefUnwindSafe for SearchQuery
impl Send for SearchQuery
impl Sync for SearchQuery
impl Unpin for SearchQuery
impl UnsafeUnpin for SearchQuery
impl UnwindSafe for SearchQuery
Blanket Implementations§
§impl<S, A> Aggregate<Result<S, Error>> for Awhere
A: Aggregate<S>,
impl<S, A> Aggregate<Result<S, Error>> for Awhere
A: Aggregate<S>,
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,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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>
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 more