pub struct RecoveredNamespaceRegion {
pub start: usize,
pub end: usize,
pub components: Vec<String>,
pub component_ranges: Vec<Range>,
pub component_name_ranges: Vec<Range>,
pub component_closes: Vec<Option<Range>>,
}Expand description
One run of a container’s children whose parsed namespaces differ from their lexical namespaces, with the complete lexical namespace path.
Fields§
§start: usizeStart byte of the first child in the run.
end: usizeEnd byte of the last child in the run.
components: Vec<String>The complete enclosing namespace path of the run, outermost first. This can be empty when a parsed namespace extends past its real close.
component_ranges: Vec<Range>The namespace Name { ... } construct that opens each of components,
parallel to it, from the namespace keyword through the close the index
proved for its {. A proven surviving namespace definition uses its
body’s direct close; a recovered head, or a namespace body exposed by
malformed member recovery, uses the file-global brace stack. A level
whose close the index could not prove – the file never closes it, or
the file’s brace token stream lost an opening token (#3328) – carries
the head alone. This is the range the declaration walk records for the
Module, so a namespace whose head collapsed into an ERROR reports
where it is written rather than where its first member is (#3309).
component_name_ranges: Vec<Range>The name token each of components is written as, parallel to it. The
declaration walk interns this subspan as the Module’s name occurrence:
the node the walk is visiting when it declares the level belongs to an
unrelated construct inside the region, and deriving the name from it
paired the level’s range with that construct’s name token (#4292).
component_closes: Vec<Option<Range>>The close the index proved for each level’s {, parallel to
components. A node after that close is outside the level (#3633).
None when the file never closes the level or the walk proved no
pairing in the file (#3328); the level then applies to the whole region
as a best-effort scope.
Trait Implementations§
Source§impl Clone for RecoveredNamespaceRegion
impl Clone for RecoveredNamespaceRegion
Source§impl Debug for RecoveredNamespaceRegion
impl Debug for RecoveredNamespaceRegion
impl Eq for RecoveredNamespaceRegion
Source§impl PartialEq for RecoveredNamespaceRegion
impl PartialEq for RecoveredNamespaceRegion
impl StructuralPartialEq for RecoveredNamespaceRegion
Auto Trait Implementations§
impl Freeze for RecoveredNamespaceRegion
impl RefUnwindSafe for RecoveredNamespaceRegion
impl Send for RecoveredNamespaceRegion
impl Sync for RecoveredNamespaceRegion
impl Unpin for RecoveredNamespaceRegion
impl UnsafeUnpin for RecoveredNamespaceRegion
impl UnwindSafe for RecoveredNamespaceRegion
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> 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.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more