pub struct Table<'a> { /* private fields */ }
Expand description
The table is a monolithic data structure representing everything the type checker knows about a program.
See module documentation.
Implementations§
Source§impl<'a> Table<'a>
impl<'a> Table<'a>
pub fn new() -> Self
pub fn entry(&self, handle: Handle) -> Entry<'_, 'a>
pub fn entry_mut(&mut self, handle: Handle) -> EntryMut<'_, 'a>
pub fn new_entry(&mut self, parent: Handle, kind: NodeKind) -> Handle
pub fn add_child( &mut self, parent: Handle, name: Sym, child: Handle, ) -> Option<Handle>
pub fn add_import( &mut self, parent: Handle, name: Sym, import: Handle, ) -> Option<Handle>
pub fn mark_use_item(&mut self, item: Handle)
pub fn mark_impl_item(&mut self, item: Handle)
pub fn handle_iter(&mut self) -> impl Iterator<Item = Handle>
Sourcepub fn debug_entry_iter(&self) -> impl Iterator<Item = Entry<'_, 'a>>
pub fn debug_entry_iter(&self) -> impl Iterator<Item = Entry<'_, 'a>>
Returns handles to all nodes sequentially by Entry
pub const fn root_entry(&self) -> Entry<'_, 'a>
pub fn root_entry_mut(&mut self) -> EntryMut<'_, 'a>
pub const fn root(&self) -> Handle
pub fn kind(&self, node: Handle) -> Option<&NodeKind>
pub fn parent(&self, node: Handle) -> Option<&Handle>
pub fn children(&self, node: Handle) -> Option<&HashMap<Sym, Handle>>
pub fn imports(&self, node: Handle) -> Option<&HashMap<Sym, Handle>>
pub fn ty(&self, node: Handle) -> Option<&TypeKind>
pub fn span(&self, node: Handle) -> Option<&Span>
pub fn meta(&self, node: Handle) -> Option<&'a [Meta]>
pub fn source(&self, node: Handle) -> Option<&Source<'a>>
pub fn impl_target(&self, node: Handle) -> Option<Handle>
pub fn set_ty(&mut self, node: Handle, kind: TypeKind) -> Option<TypeKind>
pub fn set_span(&mut self, node: Handle, span: Span) -> Option<Span>
pub fn set_meta(&mut self, node: Handle, meta: &'a [Meta]) -> Option<&'a [Meta]>
pub fn set_source( &mut self, node: Handle, source: Source<'a>, ) -> Option<Source<'a>>
pub fn set_impl_target( &mut self, node: Handle, target: Handle, ) -> Option<Handle>
Sourcepub fn selfty(&self, node: Handle) -> Option<Handle>
pub fn selfty(&self, node: Handle) -> Option<Handle>
Gets a handle to the local Self
type, if one exists
pub fn name(&self, node: Handle) -> Option<Sym>
pub fn is_transparent(&self, node: Handle) -> bool
pub fn get_child(&self, node: Handle, name: &Sym) -> Option<Handle>
pub fn get_import(&self, node: Handle, name: &Sym) -> Option<Handle>
pub fn get_by_sym(&self, node: Handle, name: &Sym) -> Option<Handle>
Does path traversal relative to the provided node
.
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for Table<'a>
impl<'a> RefUnwindSafe for Table<'a>
impl<'a> Send for Table<'a>
impl<'a> Sync for Table<'a>
impl<'a> Unpin for Table<'a>
impl<'a> UnwindSafe for Table<'a>
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