Skip to main content

Module access

Module access 

Source
Expand description

Token-level read/write analysis.

Without type information, the analysis approximates what a statement touches from its tokens: every identifier it mentions, and every access path (x, self.groups, conn.inner) it reads or writes. A path is written by assignment, &mut path, a mutating method call on a mut binding or &mut handle, or an order-sensitive call (send, write, recv, โ€ฆ) on any receiver. Two statements conflict when one writes a path that overlaps a path the other touches.

Structsยง

Access ๐Ÿ”’
What one statement touches.

Constantsยง

KEYWORDS ๐Ÿ”’
Keywords and names that never denote a variable.
ORDERED_METHODS ๐Ÿ”’
Calls whose relative order is observable even through &self: channel, stream and I/O operations on one receiver must stay in program order.
PURE_METHODS ๐Ÿ”’
Methods assumed not to mutate their receiver.
READ_PREFIXES ๐Ÿ”’
Prefixes of further read-only method names (is_*, get*, as_*, โ€ฆ).

Functionsยง

conflict ๐Ÿ”’
The first path in writes that overlaps a path in other.
format_captures ๐Ÿ”’
Names captured by {name} / {name:spec} in a string literal (format-string arguments).
is_punct ๐Ÿ”’
mentions ๐Ÿ”’
Identifiers mentioned by tokens, ignoring mutability.
overlaps ๐Ÿ”’
True when two access paths overlap: equal, or one is a field prefix of the other.
reads_only ๐Ÿ”’
True when method is assumed not to mutate its receiver.
root ๐Ÿ”’
The identifier a dotted path starts from.
scan ๐Ÿ”’
Record what tokens touch into acc.

Type Aliasesยง

Set ๐Ÿ”’
A set of identifier names or dotted access paths.