#[non_exhaustive]pub struct ParseOptions {
pub format: Option<FormatId>,
pub acquisition_root: Option<PathBuf>,
}Expand description
Optional configuration for parse_with_options. Every field defaults to
inference, so ParseOptions::default is what parse uses.
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.format: Option<FormatId>The parser selected by its stable format token rather than inferred from the input’s name and content.
acquisition_root: Option<PathBuf>The directory beneath which a format may refer to further files, widening the default of the input file’s own directory.
Implementations§
Source§impl ParseOptions
impl ParseOptions
Sourcepub fn format(self, format: &str) -> Result<Self, Error>
pub fn format(self, format: &str) -> Result<Self, Error>
Select the parser by its stable format token.
§Errors
REQUEST.FORMAT.INVALID_ID when the token is not a format identifier.
Sourcepub fn format_id(self, format: FormatId) -> Self
pub fn format_id(self, format: FormatId) -> Self
Select the parser by an already validated format identity.
Sourcepub fn acquisition_root(self, root: impl Into<PathBuf>) -> Self
pub fn acquisition_root(self, root: impl Into<PathBuf>) -> Self
Permit acquisition of files a format refers to beneath root.
Trait Implementations§
Source§impl Clone for ParseOptions
impl Clone for ParseOptions
Source§fn clone(&self) -> ParseOptions
fn clone(&self) -> ParseOptions
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 ParseOptions
impl Debug for ParseOptions
Source§impl Default for ParseOptions
impl Default for ParseOptions
Source§fn default() -> ParseOptions
fn default() -> ParseOptions
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for ParseOptions
impl RefUnwindSafe for ParseOptions
impl Send for ParseOptions
impl Sync for ParseOptions
impl Unpin for ParseOptions
impl UnsafeUnpin for ParseOptions
impl UnwindSafe for ParseOptions
Blanket Implementations§
impl<T> Allocation for T
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