Skip to main content

is_mutating_method

Function is_mutating_method 

Source
pub fn is_mutating_method(name: &str) -> bool
Expand description

Whether name is a builtin method that takes a var self receiver, and so needs a mutable place at the call site rather than a value.

The question is asked by name alone, because that is what the call site has before it has evaluated a receiver. push, set, and freeze are the three, and no builtin type spells a mutating method the way another spells an immutable one.