Skip to main content

ListOptions

Struct ListOptions 

Source
#[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

Source

pub const fn with_recursive(self, recursive: bool) -> Self

Returns a copy with recursive traversal replaced.

Source

pub const fn recursive(&self) -> bool

Returns whether traversal recurses into child containers.

Returns a copy with the symbolic-link policy override replaced.

Returns the optional symbolic-link policy override.

Source

pub const fn with_include_metadata(self, include: bool) -> Self

Returns a copy with metadata inclusion replaced.

Source

pub const fn include_metadata(&self) -> bool

Returns whether metadata is requested for entries.

Source

pub const fn with_page_size(self, page_size: Option<usize>) -> Self

Returns a copy with the page-size hint replaced.

Source

pub const fn page_size(&self) -> Option<usize>

Returns the optional page-size hint.

Source

pub fn with_prefix(self, prefix: Option<String>) -> Self

Returns a copy with the lexical prefix replaced.

Source

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.

Source

pub fn with_filter(self, filter: Option<ListFilter>) -> Self

Replaces the explicit listing filter.

Source

pub fn filter(&self) -> Option<&ListFilter>

Returns the explicit listing filter.

§Returns

Some with the configured filter, or None when listing is unfiltered.

Source

pub fn object_keys() -> Self

Returns defaults for a flat object-key listing.

Source

pub const fn with_max_depth(self, max_depth: Option<usize>) -> Self

Returns a copy with the maximum descendant depth replaced.

Source

pub const fn max_depth(&self) -> Option<usize>

Returns the optional maximum descendant depth.

Source

pub const fn with_max_entries(self, max_entries: Option<usize>) -> Self

Returns a copy with the maximum returned entry count replaced.

Source

pub const fn max_entries(&self) -> Option<usize>

Returns the optional maximum returned entry count.

Source

pub const fn with_deadline(self, deadline: Option<Duration>) -> Self

Returns a copy with the maximum elapsed duration replaced.

Source

pub const fn deadline(&self) -> Option<Duration>

Returns the optional maximum elapsed duration from stream creation.

Source

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.

Source

pub fn validate_for(&self, semantics: PathSemantics) -> FsResult<()>

Validates options against the filesystem path semantics.

§Parameters
  • semantics: Provider path semantics used to validate the filter.
§Errors

Returns an invalid-options error when the configured filter is not representable under semantics.

Trait Implementations§

Source§

impl Clone for ListOptions

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ListOptions

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for ListOptions

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Eq for ListOptions

Source§

impl PartialEq for ListOptions

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for ListOptions

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.