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
impl Debug for FsProvider
Source§impl Default for FsProvider
impl Default for FsProvider
Source§impl ResourceProvider for FsProvider
impl ResourceProvider for FsProvider
Source§fn open(&self, id: &ResourceId) -> Result<Box<dyn ReadSeek>>
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>>
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>
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.fn read(&self, id: &ResourceId) -> Result<Vec<u8>>
Source§fn version(&self, id: &ResourceId) -> Result<ResourceVersion>
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>
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>
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
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>>
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§
impl Freeze for FsProvider
impl RefUnwindSafe for FsProvider
impl Send for FsProvider
impl Sync for FsProvider
impl Unpin for FsProvider
impl UnsafeUnpin for FsProvider
impl UnwindSafe for FsProvider
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