pub struct Sources { /* private fields */ }Expand description
The lines of the files read so far. Shared by reference: Sources is Send + Sync.
Implementations§
Source§impl Sources
impl Sources
Sourcepub fn lines(
&self,
path: impl AsRef<Path>,
) -> Result<Arc<Vec<String>>, IndexError>
pub fn lines( &self, path: impl AsRef<Path>, ) -> Result<Arc<Vec<String>>, IndexError>
The lines of a file, read from disk on first use. A file that cannot be read is an
IndexError::Io and is not cached.
Sourcepub fn is_cached(&self, path: impl AsRef<Path>) -> bool
pub fn is_cached(&self, path: impl AsRef<Path>) -> bool
Whether the lines of a file are cached (read by an earlier call).
Sourcepub fn cached_paths(&self) -> Vec<PathBuf>
pub fn cached_paths(&self) -> Vec<PathBuf>
The cached paths, sorted.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for Sources
impl Forget for Sources
impl Move for Sources
impl RefUnwindSafe for Sources
impl Send for Sources
impl Sync for Sources
impl Unpin for Sources
impl UnsafeUnpin for Sources
impl UnwindSafe for Sources
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