pub enum VisitorContext {
Code,
Tests,
Example,
}Expand description
The context in which code is being analyzed.
This determines how logic lines are categorized (code/tests/examples). Comments, docs, and blanks are context-independent.
Variants§
Code
Production code
Tests
Test code (in #[test] or #[cfg(test)] blocks, or tests/ directory)
Example
Example code (in examples/ directory)
Implementations§
Source§impl VisitorContext
impl VisitorContext
Sourcepub fn from_file_path(path: impl AsRef<Path>) -> Self
pub fn from_file_path(path: impl AsRef<Path>) -> Self
Determine the context from a file path.
- Files under
tests/or namedtests.rs→ Tests - Files under
examples/→ Example - Everything else → Code
Trait Implementations§
Source§impl Clone for VisitorContext
impl Clone for VisitorContext
Source§fn clone(&self) -> VisitorContext
fn clone(&self) -> VisitorContext
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for VisitorContext
impl Debug for VisitorContext
Source§impl PartialEq for VisitorContext
impl PartialEq for VisitorContext
impl Copy for VisitorContext
impl Eq for VisitorContext
impl StructuralPartialEq for VisitorContext
Auto Trait Implementations§
impl Freeze for VisitorContext
impl RefUnwindSafe for VisitorContext
impl Send for VisitorContext
impl Sync for VisitorContext
impl Unpin for VisitorContext
impl UnwindSafe for VisitorContext
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