#[non_exhaustive]pub struct Options<'a> {
pub safe_mode: SafeMode,
pub timings: bool,
pub document_attributes: DocumentAttributes<'a>,
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<'a>§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<'a> Options<'a>
impl<'a> Options<'a>
Sourcepub fn builder() -> OptionsBuilder<'a>
pub fn builder() -> OptionsBuilder<'a>
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<'a>) -> Self
pub fn with_attributes(document_attributes: DocumentAttributes<'a>) -> 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);Sourcepub fn into_static(self) -> Options<'static>
pub fn into_static(self) -> Options<'static>
Consume the options, producing an independent 'static copy.
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for Options<'a>
impl<'a> RefUnwindSafe for Options<'a>
impl<'a> Send for Options<'a>
impl<'a> Sync for Options<'a>
impl<'a> Unpin for Options<'a>
impl<'a> UnsafeUnpin for Options<'a>
impl<'a> UnwindSafe for Options<'a>
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