pub struct OsFileProvider { /* private fields */ }Expand description
The default FileProvider that reads file: URIs from the local
filesystem.
Accepts only file: URIs; every other scheme is
WorkspaceError::UnsupportedScheme. File contents that are not
valid UTF-8 are WorkspaceError::InvalidEncoding, other I/O
failures keep their source error, and a read larger than
Self::DEFAULT_MAX_BYTES (16 MiB) is WorkspaceError::TooLarge,
unless a builder configured a different limit. The provider neither
restricts reads to the workspace roots nor caches: every lookup reads
the filesystem again.
Implementations§
Source§impl OsFileProvider
impl OsFileProvider
Sourcepub const DEFAULT_MAX_BYTES: u64
pub const DEFAULT_MAX_BYTES: u64
The default maximum size, in bytes, of one read: 16 MiB.
Sourcepub fn builder() -> OsFileProviderBuilder
pub fn builder() -> OsFileProviderBuilder
Begin configuring an OsFileProvider with a custom byte limit.
Trait Implementations§
Source§impl Clone for OsFileProvider
impl Clone for OsFileProvider
Source§fn clone(&self) -> OsFileProvider
fn clone(&self) -> OsFileProvider
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for OsFileProvider
impl Debug for OsFileProvider
Source§impl Default for OsFileProvider
impl Default for OsFileProvider
Source§impl FileProvider for OsFileProvider
impl FileProvider for OsFileProvider
Auto Trait Implementations§
impl Freeze for OsFileProvider
impl RefUnwindSafe for OsFileProvider
impl Send for OsFileProvider
impl Sync for OsFileProvider
impl Unpin for OsFileProvider
impl UnsafeUnpin for OsFileProvider
impl UnwindSafe for OsFileProvider
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