Skip to main content

CatalogEntry

Struct CatalogEntry 

Source
pub struct CatalogEntry {
    pub id: String,
    pub kind: Kind,
    pub params: Vec<String>,
    pub param_domains: Vec<Option<String>>,
    pub param_defaults: Vec<Option<String>>,
    pub param_types: Vec<Option<String>>,
    pub return_type: Option<String>,
    pub variadic: bool,
    /* private fields */
}
Expand description

One catalog builtin.

Fields§

§id: String§kind: Kind§params: Vec<String>

Parameter names, when the catalog documents them.

§param_domains: Vec<Option<String>>

The canonical enum domain expected at each parameter position, when the parameter takes an enumerated value (parallel to params). None for non-enum parameters and for parameters whose accepted values span multiple canonical domains. In particular, a filtered rule event’s Player parameter accepts EventPlayer members or canonical Hero members; the WIR crate::wir::EventTarget carries that union explicitly.

§param_defaults: Vec<Option<String>>

Default value per parameter position (parallel to params), resolved when a call omits the argument. See the catalog data provenance for the value syntax and evidence.

§param_types: Vec<Option<String>>

Evidence-backed semantic type per parameter position. None means the available sources do not prove a narrower type.

§return_type: Option<String>

Evidence-backed return type for Value entries. Actions must leave this unset; an absent value is intentionally evidence-insufficient.

§variadic: bool

Whether the final declared parameter repeats for additional arguments.

Implementations§

Source§

impl CatalogEntry

Source

pub fn spelling(&self, locale: &Locale) -> Option<&str>

The localized spelling of this builtin in locale, when declared.

Source

pub fn spellings(&self, locale: &Locale) -> &[String]

Every reviewed localized spelling of this builtin, with the first spelling reserved for deterministic emission.

Source

pub fn param_count(&self) -> usize

The number of declared arguments for this builtin.

Source

pub fn required_param_count(&self) -> usize

The number of arguments that must be present when trailing defaults are applied. A missing default in the middle of a signature remains a required position; defaults only make the suffix optional.

Source

pub fn param_domain(&self, index: usize) -> Option<&str>

The declared enum domain for an argument position, when one exists.

Source

pub fn param_type(&self, index: usize) -> Option<&str>

The evidence-backed semantic type for an argument position, when available. Enum domains remain exposed separately by param_domain.

Source

pub fn return_type(&self) -> Option<&str>

The evidence-backed return type of a Value, when available.

Trait Implementations§

Source§

impl Clone for CatalogEntry

Source§

fn clone(&self) -> CatalogEntry

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for CatalogEntry

Source§

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

Formats the value using the given formatter. 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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.