Skip to main content

is_mut_self_method

Function is_mut_self_method 

Source
fn is_mut_self_method(tcx: TyCtxt<'_>, def_id: DefId) -> bool
Expand description

Returns true when def_id is a method taking &mut self (a mutator).

Detection is based on the method signature rather than MIR, so it also works for foreign (e.g. std) functions whose MIR is unavailable.