pub struct IntroduceVariableMutation {
pub target_expr: PureExpr,
pub var_name: String,
pub target_fn: Option<SymbolId>,
pub is_mut: bool,
}Expand description
Extract an expression into a named variable
Fields§
§target_expr: PureExprThe expression to extract (matched by structure)
var_name: StringName for the new variable
target_fn: Option<SymbolId>Target function SymbolId. If None, applies to all functions.
is_mut: boolMake the variable mutable
Implementations§
Trait Implementations§
Source§impl Clone for IntroduceVariableMutation
impl Clone for IntroduceVariableMutation
Source§fn clone(&self) -> IntroduceVariableMutation
fn clone(&self) -> IntroduceVariableMutation
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 IntroduceVariableMutation
impl Debug for IntroduceVariableMutation
Source§impl Mutation for IntroduceVariableMutation
impl Mutation for IntroduceVariableMutation
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 IntroduceVariableMutation
impl RefUnwindSafe for IntroduceVariableMutation
impl Send for IntroduceVariableMutation
impl Sync for IntroduceVariableMutation
impl Unpin for IntroduceVariableMutation
impl UnsafeUnpin for IntroduceVariableMutation
impl UnwindSafe for IntroduceVariableMutation
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