pub struct MirFunction {
pub name: String,
pub signature: String,
pub body: Vec<String>,
pub span: Option<SourceSpan>,
pub hir: Option<MirFunctionHirMetadata>,
}Fields§
§name: String§signature: String§body: Vec<String>§span: Option<SourceSpan>§hir: Option<MirFunctionHirMetadata>Implementations§
Source§impl MirFunction
impl MirFunction
Sourcepub fn is_test_code(&self) -> bool
pub fn is_test_code(&self) -> bool
v1.0.1: Returns true if this function is test code that should be excluded from analysis.
Detects test code based on:
- File path patterns (tests/, examples/, benches/)
- Function name patterns (test_, ::tests::, ::mock_)
- Test attributes (#test, #[cfg(test)])
Sourcepub fn is_example_code(&self) -> bool
pub fn is_example_code(&self) -> bool
v1.0.1: Returns true if this function is example code
Sourcepub fn is_bench_code(&self) -> bool
pub fn is_bench_code(&self) -> bool
v1.0.1: Returns true if this function is benchmark code
Trait Implementations§
Source§impl Clone for MirFunction
impl Clone for MirFunction
Source§fn clone(&self) -> MirFunction
fn clone(&self) -> MirFunction
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 MirFunction
impl Debug for MirFunction
Source§impl Default for MirFunction
impl Default for MirFunction
Source§impl<'de> Deserialize<'de> for MirFunction
impl<'de> Deserialize<'de> for MirFunction
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 MirFunction
impl PartialEq for MirFunction
Source§impl Serialize for MirFunction
impl Serialize for MirFunction
impl StructuralPartialEq for MirFunction
Auto Trait Implementations§
impl Freeze for MirFunction
impl RefUnwindSafe for MirFunction
impl Send for MirFunction
impl Sync for MirFunction
impl Unpin for MirFunction
impl UnsafeUnpin for MirFunction
impl UnwindSafe for MirFunction
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more