Enum sway_ast::token::CommentKind
source · pub enum CommentKind {
Newlined,
Trailing,
Inlined,
Multilined,
}
Variants§
Newlined
A newlined comment is a comment with a preceding newline before another token.
Examples
pub fn main() -> bool {
// Newlined comment
true
}
Trailing
A trailing comment is a comment without a preceding newline before another token.
Examples
var foo = 1; // Trailing comment
Inlined
An inlined comment is a block comment nested between 2 tokens without a newline after it.
Examples
fn some_function(baz: /* inlined comment */ u64) {}
Multilined
A multiline comment is a block comment that may be nested between 2 tokens with 1 or more newlines within it.
Examples
fn some_function(baz: /* multiline
comment */ u64) {}
Trait Implementations§
source§impl Clone for CommentKind
impl Clone for CommentKind
source§fn clone(&self) -> CommentKind
fn clone(&self) -> CommentKind
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for CommentKind
impl Debug for CommentKind
source§impl Hash for CommentKind
impl Hash for CommentKind
source§impl PartialEq<CommentKind> for CommentKind
impl PartialEq<CommentKind> for CommentKind
source§fn eq(&self, other: &CommentKind) -> bool
fn eq(&self, other: &CommentKind) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd<CommentKind> for CommentKind
impl PartialOrd<CommentKind> for CommentKind
source§fn partial_cmp(&self, other: &CommentKind) -> Option<Ordering>
fn partial_cmp(&self, other: &CommentKind) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moreimpl Eq for CommentKind
impl StructuralEq for CommentKind
impl StructuralPartialEq for CommentKind
Auto Trait Implementations§
impl RefUnwindSafe for CommentKind
impl Send for CommentKind
impl Sync for CommentKind
impl Unpin for CommentKind
impl UnwindSafe for CommentKind
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
§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more