pub struct Options { /* private fields */ }Expand description
Options that can be passed to the parser.
Implementations§
Source§impl Options
impl Options
Sourcepub const fn encoding_locked(self, locked: bool) -> Self
pub const fn encoding_locked(self, locked: bool) -> Self
Sets the encoding locked option.
Sourcepub const fn frozen_string_literal(self, frozen: Option<bool>) -> Self
pub const fn frozen_string_literal(self, frozen: Option<bool>) -> Self
Sets the frozen string literal option. Some(true) freezes string
literals, Some(false) keeps them mutable, and None leaves the
option unset.
Sourcepub fn command_line(self, command_line: Vec<CommandLineFlag>) -> Self
pub fn command_line(self, command_line: Vec<CommandLineFlag>) -> Self
Sets the command line flags.
Sourcepub const fn main_script(self, main_script: bool) -> Self
pub const fn main_script(self, main_script: bool) -> Self
Sets the main script option.
Sourcepub const fn partial_script(self, partial_script: bool) -> Self
pub const fn partial_script(self, partial_script: bool) -> Self
Sets the partial script option.
Sourcepub fn scopes(self, scopes: Vec<Scope>) -> Self
pub fn scopes(self, scopes: Vec<Scope>) -> Self
Sets the scopes, replacing any previously added scopes.
Sourcepub fn build(self) -> ParseOptions
pub fn build(self) -> ParseOptions
Builds the C-level parse options from these options. The returned
ParseOptions must outlive any ParseResult created from it.
§Panics
Panics if filepath or encoding contain interior null bytes.
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