pub struct KeysQuery {
pub offset: Option<usize>,
pub limit: Option<usize>,
}
Fields§
§offset: Option<usize>
The number of documents to skip.
If the value of the parameter offset
is n
, the n
first documents (ordered by relevance) will not be returned.
This is helpful for pagination.
Example: If you want to skip the first document, set offset to 1
.
limit: Option<usize>
The maximum number of documents returned.
If the value of the parameter limit
is n
, there will never be more than n
documents in the response.
This is helpful for pagination.
Example: If you don’t want to get more than two documents, set limit to 2
.
Default: 20
Implementations§
Source§impl KeysQuery
impl KeysQuery
Sourcepub fn with_offset(&mut self, offset: usize) -> &mut KeysQuery
pub fn with_offset(&mut self, offset: usize) -> &mut KeysQuery
Specify the offset.
§Example
let mut keys = KeysQuery::new()
.with_offset(1)
.execute(&client).await.unwrap();
assert_eq!(keys.offset, 1);
Sourcepub fn with_limit(&mut self, limit: usize) -> &mut KeysQuery
pub fn with_limit(&mut self, limit: usize) -> &mut KeysQuery
Specify the maximum number of keys to return.
§Example
let mut keys = KeysQuery::new()
.with_limit(1)
.execute(&client).await.unwrap();
assert_eq!(keys.results.len(), 1);
Sourcepub async fn execute<Http: HttpClient>(
&self,
client: &Client<Http>,
) -> Result<KeysResults, Error>
pub async fn execute<Http: HttpClient>( &self, client: &Client<Http>, ) -> Result<KeysResults, Error>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for KeysQuery
impl RefUnwindSafe for KeysQuery
impl Send for KeysQuery
impl Sync for KeysQuery
impl Unpin for KeysQuery
impl UnwindSafe for KeysQuery
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§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>
Converts
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>
Converts
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