pub enum Scope {
Global,
File,
}Expand description
How far a name reaches, and therefore what it may be compared against.
A Global name is one other files can use, and an edge on it may cross a
file boundary. A File name reaches only its own file — a const inside a
function body, a parameter, an import binding — and an edge on it may only
join classes in that same file.
The distinction is the whole guard. ADR 0023 counted only global names
because mod template; and fn from became globally unique symbols that
every file mentioning the word then linked to: six such words made 64% of
one range’s edges. A name confined to its file cannot do that, however
common it is — the worst it can cost is an ordering inside one file.
Variants§
Global
Usable from another file. Edges may cross files.
File
Usable only inside the file it was read from.
Trait Implementations§
impl Copy for Scope
impl Eq for Scope
Source§impl Ord for Scope
impl Ord for Scope
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialOrd for Scope
impl PartialOrd for Scope
impl StructuralPartialEq for Scope
Auto Trait Implementations§
impl Freeze for Scope
impl RefUnwindSafe for Scope
impl Send for Scope
impl Sync for Scope
impl Unpin for Scope
impl UnsafeUnpin for Scope
impl UnwindSafe for Scope
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.