Enum Namespace Copy item path Source pub enum Namespace {
Value,
Type,
Module,
Macro,
Label,
Const,
}Expand description One of the language-level namespaces a name can live in.
HIR paths carry a syntactic namespace (hir_lang::Ns ); these are the
tables names are stored in. A language merges tables with
Policy::with_merge (Python keeps everything in one table; Rust keeps types
and modules in one; by default constants share the value table, PHP keeps
them apart).
§ Examples
use resolve_lang::Namespace;
assert_eq! (Namespace::Value.name(), "value" );
assert_eq! (Namespace::ALL.len(), 6 );Functions, constants, globals, constructors.
Records, sums, classes, interfaces, aliases.
Macros. HIR has no macro items (macros expand before lowering); hosts
may still export names here through Env .
Loop and block labels. Labels are binders resolved by lowering, so no
HIR path is looked up here; the namespace exists for merging rules.
Constants (and, under Policy::php , globals and static properties):
the names a language keeps apart from its functions. Merged into
Value unless the policy separates it, as PHP does: a
PHP function and a constant (or a method and a class constant) may
share a name. A value path that is the callee of a call searches the
value table first and this one second; any other value path searches
this one first.
Every namespace, in table order.
§ Examples
use resolve_lang::Namespace;
assert_eq! (Namespace::ALL[0 ], Namespace::Value);The lowercase name, for messages.
§ Examples
use resolve_lang::Namespace;
assert_eq! (Namespace::Module.name(), "module" );Performs copy-assignment from
source.
Read more Formats the value using the given formatter.
Read more Compares and returns the maximum of two values.
Read more Compares and returns the minimum of two values.
Read more Restrict a value to a certain interval.
Read more 🔬 This is a nightly-only experimental API. (clamp_to)
Restrict a value to a certain range.
Read more This method returns an ordering between
self and
other values if one exists.
Read more Tests less than (for
self and
other) and is used by the
< operator.
Read more Tests less than or equal to (for
self and
other) and is used by the
<= operator.
Read more Tests greater than (for
self and
other) and is used by the
>
operator.
Read more Tests greater than or equal to (for
self and
other) and is used by
the
>= operator.
Read more Immutably borrows from an owned value.
Read more Mutably borrows from an owned value.
Read more 🔬 This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from
self to
dest.
Read more Returns the argument unchanged.
Calls U::from(self).
That is, this conversion is whatever the implementation of
From <T> for U chooses to do.
The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning.
Read more Uses borrowed data to replace owned data, usually by cloning.
Read more The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.