Skip to main content

EntryFnIndex

Struct EntryFnIndex 

Source
pub struct EntryFnIndex<'a> { /* private fields */ }
Expand description

Bare-name → &FnDef index for the entry module only.

§Why a typed wrapper instead of raw HashMap<String, &FnDef>?

Entry-only verify exception (epic #170 Phase 5 deferred follow-up): every helper-law-hint and contextual-helper-hint walker in this module operates exclusively on top-level entry fn defs, because verify <name> parses name as a single source Ident (see src/parser/blocks.rs::parse_verify). The parser does NOT accept dotted verify targets, so dep-module fns are unreachable from the verify-law surface today. Bare-name keying is therefore identity-safe by the parser invariant.

The typed wrapper exists so any future change that tries to thread dep-module fns through this surface trips the compiler: a HashMap<String, &FnDef> from a dep module won’t coerce into EntryFnIndex, forcing the contributor to confront the keying question explicitly. When module-scoped verify ships, the right migration is to drop this wrapper in favour of an FnId-keyed view sourced from CodegenContext.resolved_program.

temporary-migration-bridge: deferred per epic #170 audit (no live trigger today; documented in project_phase_e_scope_b_deferred memory).

Implementations§

Source§

impl<'a> EntryFnIndex<'a>

Source

pub fn from_entry_items(items: &'a [TopLevel]) -> Self

Build the index by walking entry-scope TopLevel items. Dep modules are intentionally NOT considered — see type doc.

Source

pub fn get(&self, name: &str) -> Option<&&'a FnDef>

Bare-name lookup. Safe by parser invariant — see type doc.

Source

pub fn contains_key(&self, name: &str) -> bool

Existence check. Same identity contract as Self::get.

Auto Trait Implementations§

§

impl<'a> Freeze for EntryFnIndex<'a>

§

impl<'a> RefUnwindSafe for EntryFnIndex<'a>

§

impl<'a> Send for EntryFnIndex<'a>

§

impl<'a> Sync for EntryFnIndex<'a>

§

impl<'a> Unpin for EntryFnIndex<'a>

§

impl<'a> UnsafeUnpin for EntryFnIndex<'a>

§

impl<'a> UnwindSafe for EntryFnIndex<'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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V