Skip to main content

FsProvider

Struct FsProvider 

Source
pub struct FsProvider;
Expand description

Local files, using the same discovery filters and no-follow walk as discover.

On Unix, read, open and version reach a resource from “/” one component at a time without following any symbolic link, so swapping an ancestor for a link cannot redirect them outside the tree that discovery walked. Resource ids must therefore be canonical paths, as discovery and SearchEngine produce. An id with a link component (an explicit symlink, or an alias such as /tmp or /var on macOS) fails closed with an error that says so; canonicalize such a path before building its id. On Windows these methods remain path-based and are not pinned.

Trait Implementations§

Source§

impl Debug for FsProvider

Source§

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

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

impl Default for FsProvider

Source§

fn default() -> Self

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

impl ResourceProvider for FsProvider

Source§

fn open(&self, id: &ResourceId) -> Result<Box<dyn ReadSeek>>

Seekable source for bounded audio reads; no whole-file fallback.
Source§

fn list(&self, scope: &ResourceScope) -> Result<Vec<ProvidedResource>>

Return resources in deterministic order, without duplicate identities.
Source§

fn list_walked(&self, scope: &ResourceScope) -> Result<ResourceListing>

list, plus the resolved root identity each scope root was walked under when the provider can prove it. The default proves nothing.
Source§

fn read(&self, id: &ResourceId) -> Result<Vec<u8>>

Source§

fn version(&self, id: &ResourceId) -> Result<ResourceVersion>

Return a change token consistent with the token supplied by list. Equal known tokens let the warm pass skip reading when preparation is unchanged. Filesystem size and mtime are cheap change hints, not proof of unchanged bytes: an equal-size rewrite with a restored mtime can leave stale vectors and keyword rows. Extraction still checks the content hash and refuses changed text. Use unknown tokens in both list and version to force a reread and hash check.
Source§

fn deletion_scope(&self, scope: &ResourceScope) -> Result<ResourceScope>

Resolve deletion roots once per pass, before filtering cached identities. An error retains entries and is reported as skipped work by the engine.
Source§

fn is_deleted(&self, id: &ResourceId, scope: &ResourceScope) -> Result<bool>

True only for confirmed deletion inside scope. Errors and exclusions must not count as deletion. Pass the scope returned by deletion_scope. The conservative default retains entries.
Source§

fn supports_cached_listing(&self) -> bool

Opt in to authorizing indexed identities without discovering uncached descendants. Other providers retain their normal listing behavior in cached-only searches.
Source§

fn list_cached( &self, scope: &ResourceScope, _ids: &[ResourceId], ) -> Result<Vec<ProvidedResource>>

Current eligibility for supplied cached identities, including scope and policy. Called only after supports_cached_listing opts in; no content may be read here.

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> ErasedDestructor for T
where T: 'static,

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<F, T> IntoSample<T> for F
where T: FromSample<F>,

Source§

fn into_sample(self) -> T

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, S> SimdFrom<T, S> for T
where S: Simd,

Source§

fn simd_from(value: T, _simd: S) -> T

Source§

impl<F, T, S> SimdInto<T, S> for F
where T: SimdFrom<F, S>, S: Simd,

Source§

fn simd_into(self, simd: S) -> T

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.