pub enum CodeType {
Production,
Test,
TestUtility,
Benchmark,
Example,
BuildScript,
}Expand description
Classification of code type
Variants§
Production
Production code
Test
Test code (marked with #test or in #[cfg(test)])
TestUtility
Test utility code (in test module but not a test)
Benchmark
Benchmark code
Example
Example code
BuildScript
Build script code
Implementations§
Source§impl CodeType
impl CodeType
Sourcepub fn is_production(&self) -> bool
pub fn is_production(&self) -> bool
Checks if this is any type of test code
§Returns
true if code type is Test, TestUtility, or Benchmark
§Examples
use rust_diff_analyzer::types::CodeType;
assert!(CodeType::Test.is_test_related());
assert!(CodeType::TestUtility.is_test_related());
assert!(CodeType::Benchmark.is_test_related());
assert!(!CodeType::Production.is_test_related());Trait Implementations§
Source§impl<'de> Deserialize<'de> for CodeType
impl<'de> Deserialize<'de> for CodeType
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
impl Copy for CodeType
impl Eq for CodeType
impl StructuralPartialEq for CodeType
Auto Trait Implementations§
impl Freeze for CodeType
impl RefUnwindSafe for CodeType
impl Send for CodeType
impl Sync for CodeType
impl Unpin for CodeType
impl UnwindSafe for CodeType
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