HasDefaultBuiltInCommands

Trait HasDefaultBuiltInCommands 

Source
pub trait HasDefaultBuiltInCommands: TexlangState {
    // Required method
    fn default_built_in_commands() -> HashMap<&'static str, BuiltIn<Self>>;
}
Expand description

States that implement this trait have a default set of built-in commands associated to them.

In general in Texlang, the same state type can be used with different sets of built-in commands. However in many situations the state type has a specific set of built-ins associated to it. For example, the state type corresponding to pdfTeX is associated with the set of built-ins provided by pdfTeX.

This trait is used to specify this association. The benefit is that creating new VMs and deserializing VMs is a bit easier because the built-in commands don’t need to be provided explicitly. Moreover, if a state implements this trait the associated VM implements serde’s deserialize trait.

Required Methods§

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§