pub struct SearchOptions {
pub limit: usize,
pub offset: usize,
pub media_kind: Option<MediaKind>,
pub format: Option<String>,
}Expand description
Options that govern local FTS search and remote provider queries.
Construct with Default::default and chain builders:
ⓘ
let opts = SearchOptions::default()
.with_limit(10)
.with_offset(20)
.with_media_kind(MediaKind::Anime)
.with_format("TV");Fields§
§limit: usizeMaximum number of results to return. Default: 20.
offset: usizeNumber of results to skip for pagination. Default: 0.
media_kind: Option<MediaKind>Restrict results to one media kind. Default: none (all kinds).
format: Option<String>Restrict results to those with a matching format field value (e.g. "MOVIE").
Implementations§
Source§impl SearchOptions
impl SearchOptions
pub fn with_limit(self, limit: usize) -> Self
pub fn with_offset(self, offset: usize) -> Self
pub fn with_media_kind(self, media_kind: MediaKind) -> Self
pub fn with_format(self, format: impl Into<String>) -> Self
Trait Implementations§
Source§impl Clone for SearchOptions
impl Clone for SearchOptions
Source§fn clone(&self) -> SearchOptions
fn clone(&self) -> SearchOptions
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 SearchOptions
impl Debug for SearchOptions
Source§impl Default for SearchOptions
impl Default for SearchOptions
Source§impl<'de> Deserialize<'de> for SearchOptions
impl<'de> Deserialize<'de> for SearchOptions
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
Source§impl PartialEq for SearchOptions
impl PartialEq for SearchOptions
Source§fn eq(&self, other: &SearchOptions) -> bool
fn eq(&self, other: &SearchOptions) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for SearchOptions
impl Serialize for SearchOptions
impl StructuralPartialEq for SearchOptions
Auto Trait Implementations§
impl Freeze for SearchOptions
impl RefUnwindSafe for SearchOptions
impl Send for SearchOptions
impl Sync for SearchOptions
impl Unpin for SearchOptions
impl UnsafeUnpin for SearchOptions
impl UnwindSafe for SearchOptions
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