pub struct FsLoader;Expand description
Loader that reads files from the filesystem with std::fs::read_to_string.
This is the production loader used by the CLI; the LSP wraps it with a
file-watch invalidation layer in PR 8. lex-core’s resolver code does not
reference std::fs — FsLoader is the one place where it does, isolated
behind the Loader trait so the rest of the crate stays sandbox- and
WASM-friendly.
FsLoader is stateless; construct one at the start of a resolution and
share it for the duration. Errors map cleanly:
std::io::ErrorKind::NotFound→LoadError::NotFound- any other I/O error →
LoadError::Io
Implementations§
Trait Implementations§
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more