pub struct DefaultMutation {
pub target_struct: Option<String>,
pub use_derive: bool,
}Expand description
Fields§
§target_struct: Option<String>Only apply to specific struct
use_derive: boolUse #[derive(Default)] instead of impl (default: true)
Implementations§
Source§impl DefaultMutation
impl DefaultMutation
pub fn new() -> Self
Sourcepub fn for_struct(self, name: impl Into<String>) -> Self
pub fn for_struct(self, name: impl Into<String>) -> Self
Only apply to a specific struct
Sourcepub fn with_derive(self, use_derive: bool) -> Self
pub fn with_derive(self, use_derive: bool) -> Self
Use #[derive(Default)] (true) or impl Default (false)
Trait Implementations§
Source§impl Clone for DefaultMutation
impl Clone for DefaultMutation
Source§fn clone(&self) -> DefaultMutation
fn clone(&self) -> DefaultMutation
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 DefaultMutation
impl Debug for DefaultMutation
Source§impl Default for DefaultMutation
impl Default for DefaultMutation
Source§impl Detect for DefaultMutation
impl Detect for DefaultMutation
Source§fn category(&self) -> DetectCategory
fn category(&self) -> DetectCategory
Get the category for detected opportunities
Source§fn detect_name(&self) -> &'static str
fn detect_name(&self) -> &'static str
Get the mutation/pattern name
Source§fn detect_description(&self) -> &str
fn detect_description(&self) -> &str
Get description
Source§impl Mutation for DefaultMutation
impl Mutation for DefaultMutation
Source§fn mutation_type(&self) -> &'static str
fn mutation_type(&self) -> &'static str
Get the mutation type name
Source§fn validate(&self, _file: &PureFile) -> ValidationResult
fn validate(&self, _file: &PureFile) -> ValidationResult
Validate the mutation before applying Read more
Source§fn can_proceed(&self, file: &PureFile, strategy: ValidationStrategy) -> bool
fn can_proceed(&self, file: &PureFile, strategy: ValidationStrategy) -> bool
Check if this mutation can proceed with the given strategy
Auto Trait Implementations§
impl Freeze for DefaultMutation
impl RefUnwindSafe for DefaultMutation
impl Send for DefaultMutation
impl Sync for DefaultMutation
impl Unpin for DefaultMutation
impl UnsafeUnpin for DefaultMutation
impl UnwindSafe for DefaultMutation
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