pub struct AnalysisScope {
pub analyzed_files: Vec<PathBuf>,
pub skipped_files: Vec<SkippedFile>,
pub exclusion_patterns: Vec<String>,
}Expand description
Scope of the analysis showing what was analyzed and what was skipped
Fields§
§analyzed_files: Vec<PathBuf>Files that were analyzed
skipped_files: Vec<SkippedFile>Files that were skipped
exclusion_patterns: Vec<String>Patterns used for exclusion
Implementations§
Source§impl AnalysisScope
impl AnalysisScope
Sourcepub fn add_analyzed(&mut self, path: PathBuf)
pub fn add_analyzed(&mut self, path: PathBuf)
Sourcepub fn add_skipped(&mut self, path: PathBuf, reason: ExclusionReason)
pub fn add_skipped(&mut self, path: PathBuf, reason: ExclusionReason)
Adds a skipped file to the scope
§Arguments
path- Path to the skipped filereason- Reason for exclusion
§Examples
use std::path::PathBuf;
use rust_diff_analyzer::types::{AnalysisScope, ExclusionReason};
let mut scope = AnalysisScope::new();
scope.add_skipped(
PathBuf::from("tests/test.rs"),
ExclusionReason::IgnorePattern("tests/".to_string()),
);
assert_eq!(scope.skipped_files.len(), 1);Sourcepub fn set_patterns(&mut self, patterns: Vec<String>)
pub fn set_patterns(&mut self, patterns: Vec<String>)
Sourcepub fn non_rust_count(&self) -> usize
pub fn non_rust_count(&self) -> usize
Returns count of non-Rust files skipped
§Returns
Number of non-Rust files
§Examples
use std::path::PathBuf;
use rust_diff_analyzer::types::{AnalysisScope, ExclusionReason};
let mut scope = AnalysisScope::new();
scope.add_skipped(PathBuf::from("README.md"), ExclusionReason::NonRust);
scope.add_skipped(PathBuf::from("Cargo.toml"), ExclusionReason::NonRust);
assert_eq!(scope.non_rust_count(), 2);Sourcepub fn ignored_count(&self) -> usize
pub fn ignored_count(&self) -> usize
Returns count of files skipped due to ignore patterns
§Returns
Number of ignored files
§Examples
use std::path::PathBuf;
use rust_diff_analyzer::types::{AnalysisScope, ExclusionReason};
let mut scope = AnalysisScope::new();
scope.add_skipped(
PathBuf::from("tests/test.rs"),
ExclusionReason::IgnorePattern("tests/".to_string()),
);
assert_eq!(scope.ignored_count(), 1);Trait Implementations§
Source§impl Clone for AnalysisScope
impl Clone for AnalysisScope
Source§fn clone(&self) -> AnalysisScope
fn clone(&self) -> AnalysisScope
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 AnalysisScope
impl Debug for AnalysisScope
Source§impl Default for AnalysisScope
impl Default for AnalysisScope
Source§fn default() -> AnalysisScope
fn default() -> AnalysisScope
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for AnalysisScope
impl<'de> Deserialize<'de> for AnalysisScope
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for AnalysisScope
impl PartialEq for AnalysisScope
Source§impl Serialize for AnalysisScope
impl Serialize for AnalysisScope
impl Eq for AnalysisScope
impl StructuralPartialEq for AnalysisScope
Auto Trait Implementations§
impl Freeze for AnalysisScope
impl RefUnwindSafe for AnalysisScope
impl Send for AnalysisScope
impl Sync for AnalysisScope
impl Unpin for AnalysisScope
impl UnwindSafe for AnalysisScope
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