Skip to main content

TextForm

Trait TextForm 

Source
pub trait TextForm: Sized {
    const NAME: &'static str;
    const OPTIONS: &'static [OptionSpec];

    // Required methods
    fn make(given: &Given<'_>) -> Result<Self, String>;
    fn options(&self) -> Options;
}
Expand description

A program’s choices that are not a pass, stated as a pass is (read-fromsoft-area{area=m10_00_00_00,margin=30}): a name, the options it takes declared once, made from what the declaration let through, and printing back what it was made with. crate::pass::parse_text_form reads it and crate::pass::text_form writes it, with the declaration’s refusals (an undeclared key, a missing required option, a value outside a choice’s) in a pass’s words; crate::pass::validate_text_form checks the declaration as crate::pass::PassRegistry::add checks a pass’s.

Required Associated Constants§

Source

const NAME: &'static str

The name its text starts with.

Source

const OPTIONS: &'static [OptionSpec]

The options it takes.

Required Methods§

Source

fn make(given: &Given<'_>) -> Result<Self, String>

It, from what the declaration let through; the refusal names the option whose value it cannot take.

Source

fn options(&self) -> Options

Its options, as text: what it was made with.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§