cl_typeck::table

Struct Table

Source
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>

Source

pub fn new() -> Self

Source

pub fn entry(&self, handle: Handle) -> Entry<'_, 'a>

Source

pub fn entry_mut(&mut self, handle: Handle) -> EntryMut<'_, 'a>

Source

pub fn new_entry(&mut self, parent: Handle, kind: NodeKind) -> Handle

Source

pub fn add_child( &mut self, parent: Handle, name: Sym, child: Handle, ) -> Option<Handle>

Source

pub fn add_import( &mut self, parent: Handle, name: Sym, import: Handle, ) -> Option<Handle>

Source

pub fn mark_use_item(&mut self, item: Handle)

Source

pub fn mark_impl_item(&mut self, item: Handle)

Source

pub fn handle_iter(&mut self) -> impl Iterator<Item = Handle>

Source

pub fn debug_entry_iter(&self) -> impl Iterator<Item = Entry<'_, 'a>>

Returns handles to all nodes sequentially by Entry

Source

pub const fn root_entry(&self) -> Entry<'_, 'a>

Source

pub fn root_entry_mut(&mut self) -> EntryMut<'_, 'a>

Source

pub const fn root(&self) -> Handle

Source

pub fn kind(&self, node: Handle) -> Option<&NodeKind>

Source

pub fn parent(&self, node: Handle) -> Option<&Handle>

Source

pub fn children(&self, node: Handle) -> Option<&HashMap<Sym, Handle>>

Source

pub fn imports(&self, node: Handle) -> Option<&HashMap<Sym, Handle>>

Source

pub fn ty(&self, node: Handle) -> Option<&TypeKind>

Source

pub fn span(&self, node: Handle) -> Option<&Span>

Source

pub fn meta(&self, node: Handle) -> Option<&'a [Meta]>

Source

pub fn source(&self, node: Handle) -> Option<&Source<'a>>

Source

pub fn impl_target(&self, node: Handle) -> Option<Handle>

Source

pub fn set_ty(&mut self, node: Handle, kind: TypeKind) -> Option<TypeKind>

Source

pub fn set_span(&mut self, node: Handle, span: Span) -> Option<Span>

Source

pub fn set_meta(&mut self, node: Handle, meta: &'a [Meta]) -> Option<&'a [Meta]>

Source

pub fn set_source( &mut self, node: Handle, source: Source<'a>, ) -> Option<Source<'a>>

Source

pub fn set_impl_target( &mut self, node: Handle, target: Handle, ) -> Option<Handle>

Source

pub fn selfty(&self, node: Handle) -> Option<Handle>

Gets a handle to the local Self type, if one exists

Source

pub fn name(&self, node: Handle) -> Option<Sym>

Source

pub fn is_transparent(&self, node: Handle) -> bool

Source

pub fn get_child(&self, node: Handle, name: &Sym) -> Option<Handle>

Source

pub fn get_import(&self, node: Handle, name: &Sym) -> Option<Handle>

Source

pub fn get_by_sym(&self, node: Handle, name: &Sym) -> Option<Handle>

Source

pub fn nav(&self, node: Handle, path: &[PathPart]) -> Option<Handle>

Does path traversal relative to the provided node.

Trait Implementations§

Source§

impl<'a> Debug for Table<'a>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Table<'_>

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.