Skip to main content

CwlDb

Struct CwlDb 

Source
pub struct CwlDb;
Expand description

Handle to the lower-precision CWL tier: a broad set of command/environment names plus argument shapes harvested from the TeXstudio CWL corpus (a curated package subset; see scripts/gen_cwl_signatures.py). It carries names and arity only — every behavior flag (content/verbatim/sectioning/math/…) is left at its default — so it can widen completion and the formatter’s arity lookup without its low-confidence data ever reaching a lexer/outline behavior decision. Consulted strictly under builtin (via Signatures); the curated tier always wins. A ZST over the generated phf statics, so its query methods mirror SignatureDb’s without owning a heap map.

Implementations§

Source§

impl CwlDb

Source

pub fn command(&self, name: &str) -> Option<&'static CommandSig>

The signature of command name (without the leading \), if in the tier.

Source

pub fn environment(&self, name: &str) -> Option<&'static EnvironmentSig>

The signature of environment name, if in the tier.

Source

pub fn command_names(&self) -> impl Iterator<Item = &str>

All CWL command names (without the leading \), in arbitrary order. The &str lifetime is tied to &self (not 'static) so it unifies with the borrowed scanned-definition names in a completion chain (see completion::command_candidates), exactly like SignatureDb::command_names.

Source

pub fn environment_names(&self) -> impl Iterator<Item = &str>

All CWL environment names, in arbitrary order. See command_names.

Source

pub fn command_sigs(&self) -> impl Iterator<Item = &'static CommandSig>

All CWL command signatures (introspection; backs the invariant tests).

Source

pub fn environment_sigs(&self) -> impl Iterator<Item = &'static EnvironmentSig>

All CWL environment signatures (introspection; backs the invariant tests).

Trait Implementations§

Source§

impl Clone for CwlDb

Source§

fn clone(&self) -> CwlDb

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 Copy for CwlDb

Source§

impl Debug for CwlDb

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl Freeze for CwlDb

§

impl RefUnwindSafe for CwlDb

§

impl Send for CwlDb

§

impl Sync for CwlDb

§

impl Unpin for CwlDb

§

impl UnsafeUnpin for CwlDb

§

impl UnwindSafe for CwlDb

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> 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 = !

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.