Skip to main content

is_mutating_method

Function is_mutating_method 

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

The methods that take a var self receiver and therefore need a mutable place at the call site.

This is cove_schema::builtins::is_mutating_method: push, set, pop, remove and freeze declare mutating in the shared table, and nothing here restates them. 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.