pub enum CommentCollectionStrategy {
Off,
Separate,
AsTokens,
}Expand description
Strategy for handling comments during parsing.
This enum determines how comments in the JSON/JSONC input are collected and represented in the resulting abstract syntax tree (AST).
Variants§
Off
Comments are not collected and are effectively ignored during parsing.
Separate
Comments are collected and stored separately from the main AST structure.
When this strategy is used, comments are placed in a CommentMap where
the key is the previous token end or start of file, or the next token start
or end of file.
AsTokens
Comments are collected and treated as tokens within the AST.
When this strategy is used, comments appear alongside other tokens in the
token stream when tokens: true is set in CollectOptions.
Trait Implementations§
Source§impl Clone for CommentCollectionStrategy
impl Clone for CommentCollectionStrategy
Source§fn clone(&self) -> CommentCollectionStrategy
fn clone(&self) -> CommentCollectionStrategy
Returns a duplicate 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 CommentCollectionStrategy
impl Debug for CommentCollectionStrategy
Source§impl Default for CommentCollectionStrategy
impl Default for CommentCollectionStrategy
Source§fn default() -> CommentCollectionStrategy
fn default() -> CommentCollectionStrategy
Returns the “default value” for a type. Read more
impl StructuralPartialEq for CommentCollectionStrategy
Auto Trait Implementations§
impl Freeze for CommentCollectionStrategy
impl RefUnwindSafe for CommentCollectionStrategy
impl Send for CommentCollectionStrategy
impl Sync for CommentCollectionStrategy
impl Unpin for CommentCollectionStrategy
impl UnwindSafe for CommentCollectionStrategy
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