pub struct ImportExtractor;Expand description
Extractor that walks an AST to produce ImportSpec entries for each
use and require statement found.
Implementations§
Source§impl ImportExtractor
impl ImportExtractor
Sourcepub fn extract(ast: &Node, file_id: FileId) -> Vec<ImportSpec>
pub fn extract(ast: &Node, file_id: FileId) -> Vec<ImportSpec>
Walk the entire AST and return one ImportSpec per use or
require statement.
Each spec carries the supplied file_id and an anchor_id derived from
the statement’s byte-offset span.
Auto Trait Implementations§
impl Freeze for ImportExtractor
impl RefUnwindSafe for ImportExtractor
impl Send for ImportExtractor
impl Sync for ImportExtractor
impl Unpin for ImportExtractor
impl UnsafeUnpin for ImportExtractor
impl UnwindSafe for ImportExtractor
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