pub struct RustParser;Implementations§
Source§impl RustParser
impl RustParser
pub fn new() -> Self
Sourcepub fn parse_file(&self, path: &Path) -> Result<RustModule>
pub fn parse_file(&self, path: &Path) -> Result<RustModule>
Parse a Rust source file.
§Errors
Returns PlisskenError::FileRead if the file cannot be read,
PlisskenError::Parse if the Rust syntax is invalid.
Trait Implementations§
Source§impl Default for RustParser
impl Default for RustParser
Source§impl Parser for RustParser
impl Parser for RustParser
Source§fn parse_file(&mut self, path: &Path) -> Result<Module>
fn parse_file(&mut self, path: &Path) -> Result<Module>
Parse a source file and return its module representation. Read more
Source§fn parse_str(&mut self, content: &str, virtual_path: &Path) -> Result<Module>
fn parse_str(&mut self, content: &str, virtual_path: &Path) -> Result<Module>
Parse source code from a string. Read more
Source§fn language(&self) -> ParserLanguage
fn language(&self) -> ParserLanguage
The language this parser handles.
Source§fn extensions(&self) -> &'static [&'static str]
fn extensions(&self) -> &'static [&'static str]
File extensions this parser handles.
Source§fn can_parse_extension(&self, ext: &str) -> bool
fn can_parse_extension(&self, ext: &str) -> bool
Check if this parser can handle the given file extension.
Auto Trait Implementations§
impl Freeze for RustParser
impl RefUnwindSafe for RustParser
impl Send for RustParser
impl Sync for RustParser
impl Unpin for RustParser
impl UnsafeUnpin for RustParser
impl UnwindSafe for RustParser
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