pub struct ParseOptions { /* private fields */ }Expand description
Options for controlling how a source file is parsed.
You can construct a ParseOptions directly from a Mode:
use ruff_python_parser::{Mode, ParseOptions};
let options = ParseOptions::from(Mode::Module);or from a PySourceType
use ruff_python_ast::PySourceType;
use ruff_python_parser::ParseOptions;
let options = ParseOptions::from(PySourceType::Python);Implementations§
Source§impl ParseOptions
impl ParseOptions
pub fn with_target_version(self, target_version: PythonVersion) -> ParseOptions
pub fn target_version(&self) -> PythonVersion
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 · 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 From<Mode> for ParseOptions
impl From<Mode> for ParseOptions
Source§fn from(mode: Mode) -> ParseOptions
fn from(mode: Mode) -> ParseOptions
Converts to this type from the input type.
Source§impl From<PySourceType> for ParseOptions
impl From<PySourceType> for ParseOptions
Source§fn from(source_type: PySourceType) -> ParseOptions
fn from(source_type: PySourceType) -> ParseOptions
Converts to this type from the input type.
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§
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more