Enum bbscope::TagType

source ·
pub enum TagType {
    Start,
    Simple,
    DefinedArg(&'static str),
    DefinedTag(&'static strOption<&'static str>),
    SelfClosing(&'static str),
    DefaultArg(&'static str),
}
Expand description

This is the ‘silly’ part of the parser. Rather than making some actually generic system, I identified some standard ways tags are used and just made code around those ways. Probably bad but oh well.

Variants§

§

Start

Don’t make tags with this type, it’s for the system! Should ONLY have one of these! It’s like S in a grammar!

§

Simple

Stuff like [b][/b], no args, normal translation (can change tag name still)

§

DefinedArg(&'static str)

CAN have argument defined (but optional), attribute name is given in enum

§

DefinedTag(&'static strOption<&'static str>)

Some arguments turn into tags! Crazy… (like spoiler creating a “summary” tag)

§

SelfClosing(&'static str)

No closing tag, value turns into an arg with the name given in the enum

§

DefaultArg(&'static str)

The tag enclosed value provides a default for the given attribute, or not if defined. Used for [url] etc

Trait Implementations§

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.