pub trait File:
Display
+ Clone
+ Debug
+ 'static {
type Char: Character;
type SourceRefID: Copy + Debug + Default;
type LineSource: FileLineSource<Self::Char>;
// Required methods
fn path(&self) -> &Path;
fn line_source(self) -> Result<Self::LineSource, PathBuf>;
fn size(&self) -> usize;
fn sourceref(&self) -> Self::SourceRefID;
// Provided method
fn exists(&self) -> bool { ... }
}Expand description
A (virtual or physical) file.
Required Associated Types§
Sourcetype SourceRefID: Copy + Debug + Default
type SourceRefID: Copy + Debug + Default
A Copyable identifier for this file to be used in SourceReferences.
Sourcetype LineSource: FileLineSource<Self::Char>
type LineSource: FileLineSource<Self::Char>
The type of line sources to be read from the file.
Required Methods§
Sourcefn line_source(self) -> Result<Self::LineSource, PathBuf>
fn line_source(self) -> Result<Self::LineSource, PathBuf>
Returns a line source for this file. Used by a Mouth to read from this file.
Sourcefn sourceref(&self) -> Self::SourceRefID
fn sourceref(&self) -> Self::SourceRefID
Returns a SourceRefID for this file.
Provided Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.