pub struct FsLoader;Expand description
Reads files from the filesystem with std::fs. Its current directory is the process’s
working directory: without a base directory, relative paths in a document given as bytes
resolve against it, while those in a file given to super::Parser::parse_file resolve
against that file’s directory.
Implementations§
Trait Implementations§
impl Copy for FsLoader
impl Eq for FsLoader
Source§impl Loader for FsLoader
Available on crate feature fs only.
impl Loader for FsLoader
Available on crate feature
fs only.Source§fn current_dir(&self) -> Result<PathBuf>
fn current_dir(&self) -> Result<PathBuf>
The directory that relative paths in a document given as bytes, and a relative path
given to
super::Parser::parse_file, resolve against when the parser has no base
directory of its own. It is then also CURDIR for a document given as bytes (spec §7.8)
and for macro argument lists in it (spec §9.2).Source§fn canonicalize(&self, path: &Path) -> Result<PathBuf>
fn canonicalize(&self, path: &Path) -> Result<PathBuf>
path made canonical: absolute, with . and .. components and symbolic links resolved
(spec §9.3). An error when nothing exists at path.Source§fn canonicalize_optional(&self, path: &Path) -> Result<PathBuf>
fn canonicalize_optional(&self, path: &Path) -> Result<PathBuf>
Canonicalize an optional include path. Loaders may reject a missing path early; the
default keeps the behavior of existing loader implementations.
Source§fn kind(&self, path: &Path) -> Option<FileKind>
fn kind(&self, path: &Path) -> Option<FileKind>
What
path names, following symbolic links, or None if nothing exists there.Source§fn read_limited(&self, path: &Path, limit: u64) -> Result<Vec<u8>>
fn read_limited(&self, path: &Path, limit: u64) -> Result<Vec<u8>>
The contents of the regular file at
path if it holds at most limit bytes; if it holds
more, any part of it longer than limit bytes, such as its first limit + 1 bytes. A
parser with an input limit (super::Parser::set_max_input_bytes) reads files with it,
so that a large file is not read whole only to be rejected. Read moreimpl StructuralPartialEq for FsLoader
Auto Trait Implementations§
impl Freeze for FsLoader
impl RefUnwindSafe for FsLoader
impl Send for FsLoader
impl Sync for FsLoader
impl Unpin for FsLoader
impl UnsafeUnpin for FsLoader
impl UnwindSafe for FsLoader
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.