pub enum Placement {
Above,
Right,
Free,
Last,
}Expand description
A positional hint for a YAML source comment.
The parser currently recognizes these placements:
# Above
key: value # Right
# Free
next: value
# LastVariants§
Above
An own-line comment immediately before another YAML token.
This usually means the comment visually describes the following node.
Consecutive own-line comments without blank lines between them are also considered
Above, so a comment block can attach to the next YAML element as a group.
Right
A same-line comment after YAML content or syntax. Examples include key: value # Right
and - # Right for an empty sequence entry.
Free
A standalone own-line comment that is separated from nearby YAML tokens.
This is the fallback for comments that are neither same-line comments, immediately above a
following token, nor the final comment in the stream. Consumers should treat Free as not
having an obvious neighboring node.
Last
An own-line comment at the end of the input stream.
A Last comment may be followed by blank lines, but no further YAML token appears before
StreamEnd.