#[non_exhaustive]pub struct Options {
pub safe_mode: SafeMode,
pub timings: bool,
pub document_attributes: DocumentAttributes,
pub strict: bool,
}Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.safe_mode: SafeMode§timings: bool§document_attributes: DocumentAttributes§strict: boolStrict mode - fail on non-conformance instead of warn-and-continue.
When enabled, issues that would normally result in a warning and fallback behavior will instead cause parsing to fail. For example:
- Non-conforming manpage titles (not matching
name(volume)format)
Implementations§
Source§impl Options
impl Options
Sourcepub fn builder() -> OptionsBuilder
pub fn builder() -> OptionsBuilder
Create a new OptionsBuilder for fluent configuration.
§Example
use acdc_parser::{Options, SafeMode};
let options = Options::builder()
.with_safe_mode(SafeMode::Safe)
.with_timings()
.with_attribute("toc", "left")
.build();Sourcepub fn new() -> Self
pub fn new() -> Self
Create a new Options with default settings.
Equivalent to Options::default().
Sourcepub fn with_attributes(document_attributes: DocumentAttributes) -> Self
pub fn with_attributes(document_attributes: DocumentAttributes) -> Self
Create a new Options with the given document attributes.
§Example
use acdc_parser::{Options, DocumentAttributes, AttributeValue};
let mut attrs = DocumentAttributes::default();
attrs.insert("toc".into(), AttributeValue::String("left".into()));
let options = Options::with_attributes(attrs);Trait Implementations§
Auto Trait Implementations§
impl Freeze for Options
impl RefUnwindSafe for Options
impl Send for Options
impl Sync for Options
impl Unpin for Options
impl UnwindSafe for Options
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