pub enum Anchor {
Header,
Node(NodeName),
Config(NodeName, String),
ConfigTrailing(NodeName),
Edge(Edge),
GraphTrailing,
LayoutLeading,
LayoutEntry(NodeName),
LayoutTrailing,
FileTrailing,
}Expand description
Where a comment is anchored.
One enum rather than a bucket per position. Adding a construct to the
grammar then means adding a variant here — a compile error in every match
that has to handle it — instead of quietly creating another place for
comments to fall through, which is exactly how three positions were lost
when configuration blocks and layout were added.
Variants§
Header
Between the schema header and the graph block.
Node(NodeName)
Config(NodeName, String)
One entry inside a node’s configuration block.
ConfigTrailing(NodeName)
Just before a configuration block’s closing brace.
Edge(Edge)
GraphTrailing
Just before the graph block’s closing brace.
LayoutLeading
Between the graph block and layout.
LayoutEntry(NodeName)
LayoutTrailing
Just before the layout block’s closing brace.
FileTrailing
After everything else in the file.
Trait Implementations§
impl Eq for Anchor
Source§impl Ord for Anchor
impl Ord for Anchor
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
Source§impl PartialOrd for Anchor
impl PartialOrd for Anchor
impl StructuralPartialEq for Anchor
Auto Trait Implementations§
impl Freeze for Anchor
impl RefUnwindSafe for Anchor
impl Send for Anchor
impl Sync for Anchor
impl Unpin for Anchor
impl UnsafeUnpin for Anchor
impl UnwindSafe for Anchor
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
Mutably borrows from an owned value. Read more