pub struct SearchSchema {
pub text_search: bool,
pub max_page_size: usize,
pub fields: BTreeMap<String, SearchField>,
}Expand description
Provider-defined filter fields and search limits, also usable to generate help. For example, an adapter can expose an exact publishing-account filter:
use cherenkov_model_data::discovery::*;
use std::collections::BTreeMap;
let schema = SearchSchema {
text_search: false,
max_page_size: 100,
fields: BTreeMap::from([("author".to_owned(), SearchField {
description: "Publishing account or organization".to_owned(),
value_type: ValueType::String,
operators: vec![FilterOperator::Equal],
})]),
};Return this schema in DiscoveryCapabilities::search. Field types and
operators validate operands; the adapter implements their matching behavior.
Fields§
§text_search: boolWhether the provider accepts free-text queries.
max_page_size: usizeMaximum number of results requested in one page.
fields: BTreeMap<String, SearchField>Filter definitions keyed by the provider’s field names, such as author.
Implementations§
Source§impl SearchSchema
impl SearchSchema
Sourcepub fn validate(&self, query: &SearchQuery) -> Result<()>
pub fn validate(&self, query: &SearchQuery) -> Result<()>
Reject unsupported text, unknown fields, unsupported operators, and invalid operands. Validation does not perform I/O or interpret provider metadata.
Trait Implementations§
Source§impl Clone for SearchSchema
impl Clone for SearchSchema
Source§fn clone(&self) -> SearchSchema
fn clone(&self) -> SearchSchema
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for SearchSchema
impl Debug for SearchSchema
Source§impl<'de> Deserialize<'de> for SearchSchema
impl<'de> Deserialize<'de> for SearchSchema
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for SearchSchema
impl RefUnwindSafe for SearchSchema
impl Send for SearchSchema
impl Sync for SearchSchema
impl Unpin for SearchSchema
impl UnsafeUnpin for SearchSchema
impl UnwindSafe for SearchSchema
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