pub enum CommentKind {
Line,
Block,
DocLine,
DocBlock,
Directive,
License,
HtmlComment,
Shebang,
Encoding,
OptimizerHint,
VersionComment,
}Expand description
What a comment is, which is what a Policy decides against.
The kind is lexical to begin with and then refined by the comment’s own
bytes and position: a // token is Self::Line until it turns out to
carry an SPDX identifier (Self::License) or a build tag
(Self::Directive).
Variants§
Line
An ordinary one-line comment: // ..., # ..., -- ....
Block
An ordinary delimited comment: /* ... */, (* ... *).
DocLine
A one-line documentation comment, such as Rust’s /// and //!.
DocBlock
A delimited documentation comment, such as /** ... */.
Directive
A comment addressed to a tool or to the compiler: a build tag, a
linter suppression, a type-checker pragma. spec/directives.toml is
the catalogue.
License
A license or copyright notice, such as an SPDX identifier. Only
Policy::Legal keeps one.
HtmlComment
An HTML <!-- ... --> comment, which the DOM exposes to scripts.
Shebang
A #! interpreter line at the very start of the file.
Encoding
A Python source-encoding declaration in the first two lines.
OptimizerHint
A SQL optimizer hint, /*+ ... */, which the planner reads.
VersionComment
A SQL version-gated comment, /*! ... */, whose body the server
executes.
Implementations§
Source§impl CommentKind
impl CommentKind
Trait Implementations§
Source§impl Clone for CommentKind
impl Clone for CommentKind
Source§fn clone(&self) -> CommentKind
fn clone(&self) -> CommentKind
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more