pub struct SearchQuery {Show 13 fields
pub text: Option<String>,
pub task: Option<Task>,
pub source: Option<ModelSource>,
pub architecture: Option<String>,
pub quantization: Option<String>,
pub max_size_gb: Option<f64>,
pub min_size_gb: Option<f64>,
pub min_context_length: Option<u32>,
pub license: Option<String>,
pub tags: Vec<String>,
pub sort: SortOrder,
pub limit: usize,
pub offset: usize,
}Expand description
Search query for catalog
Fields§
§text: Option<String>Text search (name, description, tags)
task: Option<Task>Filter by task
source: Option<ModelSource>Filter by source
architecture: Option<String>Filter by architecture
quantization: Option<String>Filter by quantization
max_size_gb: Option<f64>Maximum size in GB
min_size_gb: Option<f64>Minimum size in GB
min_context_length: Option<u32>Minimum context length
license: Option<String>Filter by license
Filter by tags (any match)
sort: SortOrderSort order
limit: usizeMaximum results
offset: usizeOffset for pagination
Implementations§
Source§impl SearchQuery
impl SearchQuery
Sourcepub fn with_source(self, source: ModelSource) -> Self
pub fn with_source(self, source: ModelSource) -> Self
Filter by source
Sourcepub fn with_architecture(self, arch: impl Into<String>) -> Self
pub fn with_architecture(self, arch: impl Into<String>) -> Self
Filter by architecture
Sourcepub fn with_quantization(self, quant: impl Into<String>) -> Self
pub fn with_quantization(self, quant: impl Into<String>) -> Self
Filter by quantization
Sourcepub fn with_max_size_gb(self, gb: f64) -> Self
pub fn with_max_size_gb(self, gb: f64) -> Self
Set maximum size
Sourcepub fn with_min_size_gb(self, gb: f64) -> Self
pub fn with_min_size_gb(self, gb: f64) -> Self
Set minimum size
Sourcepub fn with_min_context_length(self, length: u32) -> Self
pub fn with_min_context_length(self, length: u32) -> Self
Set minimum context length
Sourcepub fn with_license(self, license: impl Into<String>) -> Self
pub fn with_license(self, license: impl Into<String>) -> Self
Filter by license
Sourcepub fn with_limit(self, limit: usize) -> Self
pub fn with_limit(self, limit: usize) -> Self
Set result limit
Sourcepub fn with_offset(self, offset: usize) -> Self
pub fn with_offset(self, offset: usize) -> Self
Set offset for pagination
Sourcepub fn matches(&self, entry: &CatalogEntry) -> bool
pub fn matches(&self, entry: &CatalogEntry) -> bool
Check if an entry matches this query
Trait Implementations§
Source§impl Clone for SearchQuery
impl Clone for SearchQuery
Source§fn clone(&self) -> SearchQuery
fn clone(&self) -> SearchQuery
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 SearchQuery
impl Debug for SearchQuery
Source§impl Default for SearchQuery
impl Default for SearchQuery
Source§fn default() -> SearchQuery
fn default() -> SearchQuery
Returns the “default value” for a type. Read more
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§
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