Module comment

Source

Structsยง

CharClasses ๐Ÿ”’
CommentCodeSlices ๐Ÿ”’
Iterator over an alternating sequence of functional and commented parts of a string. The first item is always a, possibly zero length, subslice of functional text. Line style comments contain their ending newlines.
CommentReducer ๐Ÿ”’
Iterator over the โ€˜payloadโ€™ characters of a comment. It skips whitespace, comment start/end marks, and โ€˜*โ€™ at the beginning of lines. The comment must be one comment, ie not more than one start mark (no multiple line comments, for example).
CommentRewrite ๐Ÿ”’
ItemizedBlock ๐Ÿ”’
Block that is formatted as an item.
LineClasses ๐Ÿ”’
An iterator over the lines of a string, paired with the char kind at the end of the line.
UngroupedCommentCodeSlices ๐Ÿ”’
Iterator over functional and commented parts of a string. Any part of a string is either functional code, either one block comment, either one line comment. Whitespace between comments is functional code. Line comments contain their ending newlines.

Enumsยง

CharClassesStatus ๐Ÿ”’
CodeBlockAttribute ๐Ÿ”’
Enum indicating if the code block contains rust based on attributes
CodeCharKind ๐Ÿ”’
Distinguish between functional part of code and comments
CommentStyle ๐Ÿ”’
FullCodeCharKind ๐Ÿ”’
Distinguish between functional part of code and comments, describing opening and closing of comments for ease when chunking code from tagged characters

Constantsยง

RUSTFMT_CUSTOM_COMMENT_PREFIX ๐Ÿ”’

Traitsยง

FindUncommented ๐Ÿ”’
RichChar ๐Ÿ”’

Functionsยง

changed_comment_content ๐Ÿ”’
Returns true if the two strings of code have the same payload of comments. The payload of comments is everything in the string except:
combine_strs_with_missing_comments ๐Ÿ”’
Combine prev_str and next_str into a single String. span may contain comments between two strings. If there are such comments, then that will be recovered. If allow_extend is true and there is no comment between the two strings, then they will be put on a single line as long as doing so does not exceed max width.
comment_style ๐Ÿ”’
contains_comment ๐Ÿ”’
Returns true if text contains any comment.
custom_opener ๐Ÿ”’
filter_normal_code ๐Ÿ”’
find_comment_end ๐Ÿ”’
has_url ๐Ÿ”’
Returns true if the given string MAY include URLs or alike.
hide_sharp_behind_comment ๐Ÿ”’
identify_comment ๐Ÿ”’
is_custom_comment ๐Ÿ”’
is_last_comment_block ๐Ÿ”’
Returns true if the last line of the passed string finishes with a block-comment.
is_raw_string_suffix ๐Ÿ”’
is_table_item ๐Ÿ”’
Returns true if the given string may be part of a Markdown table.
itemized_block_quote_start ๐Ÿ”’
Determine the line_start when formatting markdown block quotes. The original line_start likely contains indentation (whitespaces), which weโ€™d like to replace with โ€™> โ€™ characters.
left_trim_comment_line ๐Ÿ”’
Trims comment characters and possibly a single space from the left of a string. Does not trim all whitespace. If a single space is trimmed from the left of the string, this function returns true.
light_rewrite_comment ๐Ÿ”’
Trims whitespace and aligns to indent, but otherwise does not change comments.
recover_comment_removed ๐Ÿ”’
Checks is new didnโ€™t miss any comment from span, if it removed any, return previous text
recover_missing_comment_in_span ๐Ÿ”’
Recover the missing comments in the specified span, if available. The layout of the comments will be preserved as long as it does not break the code and its total width does not exceed the max width.
remove_comment_header ๐Ÿ”’
rewrite_comment ๐Ÿ”’
rewrite_comment_inner ๐Ÿ”’
rewrite_doc_comment ๐Ÿ”’
rewrite_missing_comment ๐Ÿ”’
Given the span, rewrite the missing comment inside it if available. Note that the given span must only include comments (or leading/trailing whitespaces).
trim_custom_comment_prefix ๐Ÿ”’
trim_end_unless_two_whitespaces ๐Ÿ”’
Trim trailing whitespaces unless they consist of two or more whitespaces.