pub struct DocumentRun<'a> { /* private fields */ }Expand description
A document run with path roles made explicit.
config_path is a logical identity used by per-file configuration. A
separate source_file is exposed to rules that may access the filesystem.
Native adapters usually set both; browser and other virtual adapters set only
config_path.
Implementations§
Source§impl<'a> DocumentRun<'a>
impl<'a> DocumentRun<'a>
pub fn new( content: &'a str, rules: &'a [Box<dyn Rule>], config: &'a Config, ) -> Self
Sourcepub fn file_path(self, path: &'a Path) -> Self
pub fn file_path(self, path: &'a Path) -> Self
Set a real file path for both per-file configuration and rule filesystem access.
Sourcepub fn config_path(self, path: Option<&'a Path>) -> Self
pub fn config_path(self, path: Option<&'a Path>) -> Self
Set a logical path used only for per-file configuration matching.
Sourcepub fn source_file(self, path: Option<&'a Path>) -> Self
pub fn source_file(self, path: Option<&'a Path>) -> Self
Set the filesystem path visible to rules independently of configuration matching.
pub fn verbose(self, verbose: bool) -> Self
pub fn flavor(&self) -> MarkdownFlavor
pub fn analyze(&self) -> Result<DocumentAnalysis, LintError>
pub fn analyze_raw(&self) -> (Result<Vec<LintWarning>, LintError>, FileIndex)
pub fn fix(&self, max_iterations: usize) -> Result<(String, FixResult), String>
pub fn config_path_buf(&self) -> Option<PathBuf>
Auto Trait Implementations§
impl<'a> !RefUnwindSafe for DocumentRun<'a>
impl<'a> !UnwindSafe for DocumentRun<'a>
impl<'a> Freeze for DocumentRun<'a>
impl<'a> Send for DocumentRun<'a>
impl<'a> Sync for DocumentRun<'a>
impl<'a> Unpin for DocumentRun<'a>
impl<'a> UnsafeUnpin for DocumentRun<'a>
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