#[non_exhaustive]pub struct ListOptions { /* private fields */ }Expand description
Options controlling directory or prefix listing.
Options are validated by crate::FileSystem::list before a provider
session is opened. A page-size hint is bounded by the provider’s declared
limit; max_depth and max_entries are caller-side safety bounds.
§Examples
use qubit_fs::directory::{ListFilter, ListOptions};
let options = ListOptions::default()
.with_page_size(Some(100))
.with_max_depth(Some(2))
.with_max_entries(Some(500))
.with_filter(Some(ListFilter::Subtree("reports".to_owned())));
assert_eq!(options.page_size(), Some(100));
assert_eq!(options.max_depth(), Some(2));
assert_eq!(options.max_entries(), Some(500));
assert!(options.validate().is_ok());Implementations§
Source§impl ListOptions
impl ListOptions
Sourcepub const fn with_recursive(self, recursive: bool) -> Self
pub const fn with_recursive(self, recursive: bool) -> Self
Returns a copy with recursive traversal replaced.
Sourcepub const fn recursive(&self) -> bool
pub const fn recursive(&self) -> bool
Returns whether traversal recurses into child containers.
Sourcepub const fn with_symlink_policy(self, policy: SymlinkPolicy) -> Self
pub const fn with_symlink_policy(self, policy: SymlinkPolicy) -> Self
Returns a copy with the symbolic-link policy override replaced.
Sourcepub const fn symlink_policy_override(&self) -> Option<SymlinkPolicy>
pub const fn symlink_policy_override(&self) -> Option<SymlinkPolicy>
Returns the optional symbolic-link policy override.
Sourcepub const fn with_include_metadata(self, include: bool) -> Self
pub const fn with_include_metadata(self, include: bool) -> Self
Returns a copy with metadata inclusion replaced.
Sourcepub const fn include_metadata(&self) -> bool
pub const fn include_metadata(&self) -> bool
Returns whether metadata is requested for entries.
Sourcepub const fn with_page_size(self, page_size: Option<usize>) -> Self
pub const fn with_page_size(self, page_size: Option<usize>) -> Self
Returns a copy with the page-size hint replaced.
Sourcepub fn with_prefix(self, prefix: Option<String>) -> Self
pub fn with_prefix(self, prefix: Option<String>) -> Self
Returns a copy with the lexical prefix replaced.
Sourcepub fn prefix(&self) -> Option<&str>
pub fn prefix(&self) -> Option<&str>
Returns the optional lexical prefix.
§Returns
Some with the configured subtree prefix, or None when no subtree
prefix filter is configured.
Sourcepub fn with_filter(self, filter: Option<ListFilter>) -> Self
pub fn with_filter(self, filter: Option<ListFilter>) -> Self
Replaces the explicit listing filter.
Sourcepub fn filter(&self) -> Option<&ListFilter>
pub fn filter(&self) -> Option<&ListFilter>
Returns the explicit listing filter.
§Returns
Some with the configured filter, or None when listing is unfiltered.
Sourcepub fn object_keys() -> Self
pub fn object_keys() -> Self
Returns defaults for a flat object-key listing.
Sourcepub const fn with_max_depth(self, max_depth: Option<usize>) -> Self
pub const fn with_max_depth(self, max_depth: Option<usize>) -> Self
Returns a copy with the maximum descendant depth replaced.
Sourcepub const fn with_max_entries(self, max_entries: Option<usize>) -> Self
pub const fn with_max_entries(self, max_entries: Option<usize>) -> Self
Returns a copy with the maximum returned entry count replaced.
Sourcepub const fn max_entries(&self) -> Option<usize>
pub const fn max_entries(&self) -> Option<usize>
Returns the optional maximum returned entry count.
Sourcepub const fn with_deadline(self, deadline: Option<Duration>) -> Self
pub const fn with_deadline(self, deadline: Option<Duration>) -> Self
Returns a copy with the maximum elapsed duration replaced.
Sourcepub const fn deadline(&self) -> Option<Duration>
pub const fn deadline(&self) -> Option<Duration>
Returns the optional maximum elapsed duration from stream creation.
Sourcepub fn validate(&self) -> FsResult<()>
pub fn validate(&self) -> FsResult<()>
Validates pagination and canonical provider-facing prefix values.
§Errors
Returns an invalid-options error when the page size is zero or the prefix is not a canonical relative path.