pub struct AstParser { /* private fields */ }Expand description
AST parser for extracting Tailwind classes from Rust source files
Implementations§
Source§impl AstParser
impl AstParser
Sourcepub fn parse_file(&mut self, path: &Path) -> Result<()>
pub fn parse_file(&mut self, path: &Path) -> Result<()>
Parse a Rust source file and extract Tailwind classes
Sourcepub fn parse_content(&mut self, content: &str) -> Result<()>
pub fn parse_content(&mut self, content: &str) -> Result<()>
Parse Rust source content and extract Tailwind classes
Sourcepub fn get_classes(&self) -> &HashSet<String>
pub fn get_classes(&self) -> &HashSet<String>
Get all extracted class names
Sourcepub fn get_responsive_classes(
&self,
breakpoint: &str,
) -> Option<&HashSet<String>>
pub fn get_responsive_classes( &self, breakpoint: &str, ) -> Option<&HashSet<String>>
Get responsive classes for a specific breakpoint
Sourcepub fn get_conditional_classes(
&self,
condition: &str,
) -> Option<&HashSet<String>>
pub fn get_conditional_classes( &self, condition: &str, ) -> Option<&HashSet<String>>
Get conditional classes for a specific condition
Sourcepub fn get_all_responsive_classes(&self) -> &HashMap<String, HashSet<String>>
pub fn get_all_responsive_classes(&self) -> &HashMap<String, HashSet<String>>
Get all responsive classes
Sourcepub fn get_all_conditional_classes(&self) -> &HashMap<String, HashSet<String>>
pub fn get_all_conditional_classes(&self) -> &HashMap<String, HashSet<String>>
Get all conditional classes
Sourcepub fn parsed_file_count(&self) -> usize
pub fn parsed_file_count(&self) -> usize
Get the number of parsed files
Sourcepub fn class_count(&self) -> usize
pub fn class_count(&self) -> usize
Get the total number of extracted classes
Sourcepub fn has_parsed_file(&self, path: &str) -> bool
pub fn has_parsed_file(&self, path: &str) -> bool
Check if a file has been parsed
Trait Implementations§
Auto Trait Implementations§
impl Freeze for AstParser
impl RefUnwindSafe for AstParser
impl Send for AstParser
impl Sync for AstParser
impl Unpin for AstParser
impl UnwindSafe for AstParser
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