Struct cl_typeck::name_collector::NameCollector

source ·
pub struct NameCollector<'prj, 'a> { /* private fields */ }

Implementations§

source§

impl<'prj, 'a> NameCollector<'prj, 'a>

source

pub fn new(prj: &'prj mut Prj<'a>) -> Self

Constructs a new NameCollector out of a Project

source

pub fn with_root(prj: &'prj mut Prj<'a>, parent: DefID) -> Self

Constructs a new NameCollector out of a Project and a parent DefID

source

pub fn with_parent<F, N>(&mut self, parent: DefID, node: N, f: F)
where F: FnOnce(&mut Self, N),

Runs the provided function with the given parent

source

pub fn returns<F, N>(&mut self, node: N, f: F) -> Option<DefID>
where F: FnOnce(&mut Self, N),

Extracts the return value from the provided function

Trait Implementations§

source§

impl<'prj, 'a> Debug for NameCollector<'prj, 'a>

source§

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

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

impl<'prj, 'a> Visit<'a> for NameCollector<'prj, 'a>

source§

fn visit_item(&mut self, i: &'a Item)

source§

fn visit_module(&mut self, m: &'a Module)

source§

fn visit_alias(&mut self, a: &'a Alias)

source§

fn visit_enum(&mut self, e: &'a Enum)

source§

fn visit_variant(&mut self, v: &'a Variant)

source§

fn visit_struct(&mut self, s: &'a Struct)

source§

fn visit_const(&mut self, c: &'a Const)

source§

fn visit_static(&mut self, s: &'a Static)

source§

fn visit_function(&mut self, f: &'a Function)

source§

fn visit_impl(&mut self, i: &'a Impl)

source§

fn visit_use(&mut self, u: &'a Use)

source§

fn visit_let(&mut self, l: &'a Let)

source§

fn visit_span(&mut self, _extents: &'a Span)

source§

fn visit_mutability(&mut self, _mutable: &'a Mutability)

source§

fn visit_visibility(&mut self, _vis: &'a Visibility)

source§

fn visit_sym(&mut self, _name: &'a Interned<'static, str>)

source§

fn visit_literal(&mut self, l: &'a Literal)

source§

fn visit_bool(&mut self, _b: &'a bool)

source§

fn visit_char(&mut self, _c: &'a char)

source§

fn visit_int(&mut self, _i: &'a u128)

source§

fn visit_string(&mut self, _s: &'a str)

source§

fn visit_file(&mut self, f: &'a File)

source§

fn visit_attrs(&mut self, a: &'a Attrs)

source§

fn visit_meta(&mut self, m: &'a Meta)

source§

fn visit_meta_kind(&mut self, kind: &'a MetaKind)

source§

fn visit_item_kind(&mut self, kind: &'a ItemKind)

source§

fn visit_module_kind(&mut self, kind: &'a ModuleKind)

source§

fn visit_param(&mut self, p: &'a Param)

source§

fn visit_struct_kind(&mut self, kind: &'a StructKind)

source§

fn visit_struct_member(&mut self, m: &'a StructMember)

source§

fn visit_enum_kind(&mut self, kind: &'a EnumKind)

source§

fn visit_variant_kind(&mut self, kind: &'a VariantKind)

source§

fn visit_impl_kind(&mut self, target: &'a ImplKind)

source§

fn visit_use_tree(&mut self, tree: &'a UseTree)

source§

fn visit_ty(&mut self, t: &'a Ty)

source§

fn visit_ty_kind(&mut self, kind: &'a TyKind)

source§

fn visit_ty_tuple(&mut self, t: &'a TyTuple)

source§

fn visit_ty_ref(&mut self, t: &'a TyRef)

source§

fn visit_ty_fn(&mut self, t: &'a TyFn)

source§

fn visit_path(&mut self, p: &'a Path)

source§

fn visit_path_part(&mut self, p: &'a PathPart)

source§

fn visit_stmt(&mut self, s: &'a Stmt)

source§

fn visit_stmt_kind(&mut self, kind: &'a StmtKind)

source§

fn visit_semi(&mut self, _s: &'a Semi)

source§

fn visit_expr(&mut self, e: &'a Expr)

source§

fn visit_expr_kind(&mut self, e: &'a ExprKind)

source§

fn visit_assign(&mut self, a: &'a Assign)

source§

fn visit_modify(&mut self, m: &'a Modify)

source§

fn visit_modify_kind(&mut self, _kind: &'a ModifyKind)

source§

fn visit_binary(&mut self, b: &'a Binary)

source§

fn visit_binary_kind(&mut self, _kind: &'a BinaryKind)

source§

fn visit_unary(&mut self, u: &'a Unary)

source§

fn visit_unary_kind(&mut self, _kind: &'a UnaryKind)

source§

fn visit_member(&mut self, m: &'a Member)

source§

fn visit_member_kind(&mut self, kind: &'a MemberKind)

source§

fn visit_index(&mut self, i: &'a Index)

source§

fn visit_structor(&mut self, s: &'a Structor)

source§

fn visit_fielder(&mut self, f: &'a Fielder)

source§

fn visit_array(&mut self, a: &'a Array)

source§

fn visit_array_rep(&mut self, a: &'a ArrayRep)

source§

fn visit_addrof(&mut self, a: &'a AddrOf)

source§

fn visit_block(&mut self, b: &'a Block)

source§

fn visit_group(&mut self, g: &'a Group)

source§

fn visit_tuple(&mut self, t: &'a Tuple)

source§

fn visit_loop(&mut self, l: &'a Loop)

source§

fn visit_while(&mut self, w: &'a While)

source§

fn visit_if(&mut self, i: &'a If)

source§

fn visit_for(&mut self, f: &'a For)

source§

fn visit_else(&mut self, e: &'a Else)

source§

fn visit_break(&mut self, b: &'a Break)

source§

fn visit_return(&mut self, r: &'a Return)

source§

fn visit_continue(&mut self, c: &'a Continue)

Auto Trait Implementations§

§

impl<'prj, 'a> Freeze for NameCollector<'prj, 'a>

§

impl<'prj, 'a> RefUnwindSafe for NameCollector<'prj, 'a>

§

impl<'prj, 'a> Send for NameCollector<'prj, 'a>

§

impl<'prj, 'a> Sync for NameCollector<'prj, 'a>

§

impl<'prj, 'a> Unpin for NameCollector<'prj, 'a>

§

impl<'prj, 'a> !UnwindSafe for NameCollector<'prj, '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>,

§

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

§

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.