#[non_exhaustive]
#[derive(Clone, Debug, Eq, PartialEq)]
pub struct Options {
pub strict_indentation: bool,
#[cfg_attr(
feature = "comments",
doc = "[`Self::max_buffered_comment_events`] has no effect while comment emission is disabled."
)]
pub emit_comments: bool,
#[cfg(feature = "comments")]
pub max_buffered_comment_events: usize,
pub simple_key_max_lookahead: usize,
pub flow_nesting_limit: usize,
pub block_nesting_limit: usize,
pub max_directive_bytes: usize,
pub max_reserved_directive_params: usize,
}
impl Options {
pub fn set_emit_comments(&mut self, emit_comments: bool) {
self.emit_comments = emit_comments;
}
}
impl Default for Options {
fn default() -> Self {
Self {
strict_indentation: false,
emit_comments: cfg!(feature = "comments"),
#[cfg(feature = "comments")]
max_buffered_comment_events: 96,
simple_key_max_lookahead: 1024,
flow_nesting_limit: 255,
block_nesting_limit: 255,
max_directive_bytes: 1024,
max_reserved_directive_params: 16,
}
}
}