Struct worker::ListOptionsBuilder
source · pub struct ListOptionsBuilder<'bucket> { /* private fields */ }
Expand description
Options for configuring the list operation.
Implementations§
source§impl<'bucket> ListOptionsBuilder<'bucket>
impl<'bucket> ListOptionsBuilder<'bucket>
sourcepub fn limit(self, limit: u32) -> Self
pub fn limit(self, limit: u32) -> Self
The number of results to return. Defaults to 1000, with a maximum of 1000.
sourcepub fn prefix(self, prefix: impl Into<String>) -> Self
pub fn prefix(self, prefix: impl Into<String>) -> Self
The prefix to match keys against. Keys will only be returned if they start with given prefix.
sourcepub fn cursor(self, cursor: impl Into<String>) -> Self
pub fn cursor(self, cursor: impl Into<String>) -> Self
An opaque token that indicates where to continue listing objects from. A cursor can be retrieved from a previous list operation.
sourcepub fn delimiter(self, delimiter: impl Into<String>) -> Self
pub fn delimiter(self, delimiter: impl Into<String>) -> Self
The character to use when grouping keys.
sourcepub fn include(self, include: Vec<Include>) -> Self
pub fn include(self, include: Vec<Include>) -> Self
If you populate this array, then items returned will include this metadata.
A tradeoff is that fewer results may be returned depending on how big this
data is. For now the caps are TBD but expect the total memory usage for a list
operation may need to be <1MB or even <128kb depending on how many list operations
you are sending into one bucket. Make sure to look at truncated
for the result
rather than having logic like
while listed.len() < limit {
listed = bucket.list()
.limit(limit),
.include(vec![Include::CustomMetadata])
.execute()
.await?;
}