Struct pdl_compiler::lint::Scope
source · pub struct Scope<'d> {
pub file: &'d File,
pub typedef: HashMap<String, &'d Decl>,
pub scopes: HashMap<&'d Decl, PacketScope<'d>>,
}
Expand description
Gather information about the full AST.
Fields§
§file: &'d File
§typedef: HashMap<String, &'d Decl>
§scopes: HashMap<&'d Decl, PacketScope<'d>>
Implementations§
source§impl<'d> Scope<'d>
impl<'d> Scope<'d>
pub fn new(file: &File) -> Scope<'_>
pub fn iter_children<'a>( &'a self, id: &'a str ) -> impl Iterator<Item = &'d Decl> + 'a
sourcepub fn get_field_declaration(&self, field: &Field) -> Option<&'d Decl>
pub fn get_field_declaration(&self, field: &Field) -> Option<&'d Decl>
Return the declaration of the typedef type backing the selected field.
sourcepub fn is_bitfield(&self, field: &Field) -> bool
pub fn is_bitfield(&self, field: &Field) -> bool
Test if the selected field is a bitfield.
Trait Implementations§
Auto Trait Implementations§
impl<'d> RefUnwindSafe for Scope<'d>
impl<'d> Send for Scope<'d>
impl<'d> Sync for Scope<'d>
impl<'d> Unpin for Scope<'d>
impl<'d> UnwindSafe for Scope<'d>
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