Skip to main content

Registry

Struct Registry 

Source
pub struct Registry {
    pub functions: HashMap<String, FunctionKind>,
    pub metadata: HashMap<String, FunctionMeta>,
}
Expand description

The runtime registry of built-in and user-registered spreadsheet functions.

Fields§

§functions: HashMap<String, FunctionKind>§metadata: HashMap<String, FunctionMeta>

Implementations§

Source§

impl Registry

Source

pub fn new() -> Self

Source

pub fn register_eager(&mut self, name: &str, f: EagerFn, meta: FunctionMeta)

Register a user-facing eager function with metadata. Appears in list_functions(). Panics if name is already registered (duplicate registration).

Source

pub fn register_lazy(&mut self, name: &str, f: LazyFn, meta: FunctionMeta)

Register a user-facing lazy function with metadata. Appears in list_functions(). Panics if name is already registered (duplicate registration).

Source

pub fn register_alias(&mut self, alias: &str, canonical: &str)

Register alias as an alternate name for canonical. The alias shares the same handler but does NOT appear in function metadata (it will not show up in list_functions() or autocomplete). Panics if alias is already registered or canonical is not yet registered.

Source

pub fn register_internal(&mut self, name: &str, f: EagerFn)

Register an internal/compiler-only eager function without metadata. Never appears in list_functions().

Source

pub fn register_internal_lazy(&mut self, name: &str, f: LazyFn)

Register an internal/compiler-only lazy function without metadata. Never appears in list_functions().

Source

pub fn get(&self, name: &str) -> Option<&FunctionKind>

Source

pub fn list_functions(&self) -> impl Iterator<Item = (&str, &FunctionMeta)>

Iterate all user-facing functions with their metadata. The registry is the single source of truth — this can never drift.

Source

pub fn get_metadata(&self) -> Vec<FunctionMetaEntry<'_>>

Return all function metadata entries as a Vec of named structs. Used for inspection (e.g. counting functions, verifying aliases are absent).

Source

pub fn metadata_names(&self) -> Vec<String>

Return all user-facing function names (from metadata, not aliases).

Source§

impl Registry

Source

pub const VOLATILE_FUNCTIONS: &'static [&'static str]

Volatile functions — outputs change on every evaluation. Excluded from conformance fixtures; covered by property tests instead.

Trait Implementations§

Source§

impl Default for Registry

Source§

fn default() -> Self

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

Auto Trait Implementations§

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.