Enum shiratsu_naming::naming::tosec::TOSECToken[][src]

pub enum TOSECToken<'a> {
    Title(&'a str),
    Version(&'a str, &'a strOption<&'a str>),
    Demo(Option<&'a str>),
    Date(&'a strOption<&'a str>, Option<&'a str>),
    Publisher(Option<Vec<&'a str>>),
    System(&'a str),
    Video(&'a str),
    Region(Vec<&'a str>, Vec<Region>),
    Languages(TOSECLanguage<'a>),
    Copyright(&'a str),
    Development(&'a str),
    DumpInfo(&'a strOption<&'a str>, Option<&'a str>),
    Media(Vec<(&'a str, &'a str, Option<&'a str>)>),
    Flag(FlagType, &'a str),
    Warning(TOSECWarn<'a>),
}

A token constituent within a TOSECToken.

Tokens are not guaranteed to have consistent semantics outside of a NoIntroName. The order of tokens in a TOSECName is significant in order of appearance in the input file name.

TOSECToken has a custom implementation of PartialOrd following the TOSEC Naming Convention.

Variants

Title(&'a str)

The title of the ROM.

Version(&'a str, &'a strOption<&'a str>)

A version flag.

Tuple elements

  1. The version type.
    • If this is Rev, a space occurs between the version type and the major version.
  2. The major version.
  3. The minor version, if any.
Demo(Option<&'a str>)

A demo flag, preceding the demo- string.

Examples

  • (demo) parses as Demo(None).
  • (demo-kiosk) parses as Demo(Some("kiosk"))
Date(&'a strOption<&'a str>, Option<&'a str>)

A date flag

Tuple elements

  1. The year.
  2. The month, if any.
  3. The day, if any.
Publisher(Option<Vec<&'a str>>)

A publisher flag, with publishers separated by - if more than one.

Examples

  • (-) parses as Publisher(None)
  • (Publisher A - Doe, John) parses as Publisher(Some(vec!["Publisher A", "Doe, John"]))
System(&'a str)

A system flag.

See the TOSEC Naming Convention for a list of valid system flags.

Video(&'a str)

A video flag.

See the TOSEC Naming Convention for a list of valid video flags.

Region(Vec<&'a str>, Vec<Region>)

The region of the ROM.

Because of the existence of GoodTools region codes in ZZZ-UNK- ROMs, you may not assume a one-to-one correspondence between the strings in the region flag, and the list of parsed regions, since GoodTools regions may go through expansion.

Tuple elements

  1. The region strings that correspond to the parsed regions.
  2. The parsed regions.
Languages(TOSECLanguage<'a>)

A language flag.

See the TOSECLanguage documentation for more details.

Copyright(&'a str)

A copyright status flag.

See the TOSEC Naming Convention for a list of valid copyright status flags.

Development(&'a str)

A development status flag.

See the TOSEC Naming Convention for a list of valid development status flags.

DumpInfo(&'a strOption<&'a str>, Option<&'a str>)

A dump info flag.

[more info]’ flags are parsed as Flag(FlagType::Bracketed, &'a str), and not DumpInfo.

See the TOSEC Naming Convention for a list of valid dump info flags.

Tuple elements

  1. The letter or name of the dump flag.
  2. The number of the dump flag, if any.
  3. The arguments or additional information of the dump flag, if any. This is an opaque string, and is not specialized with the type of the dump flag.

Example

  • [!] parses as DumpInfo("!", None, None)
  • [f1 Fix Fixer] parses as DumpInfo("f", Some("1"), Some("Fix Fixer")
Media(Vec<(&'a str, &'a str, Option<&'a str>)>)

A media part number flag.

There may be multiple media parts in a flag, separated by a space.

Media type flags are parsed as Flag(FlagType::Parenthesized, &'a str), and not Media.

Tuple elements

  1. The media part name
  2. The number of the media part.
  3. The total parts of the media, if any.

Examples

  • (Side A) parses to Media(vec![("Side", "A", None)]).
  • (Disc 1 of 2 Side B) parses to Media(vec[("Disc", "1", Some("2")), ("Side", "B", None)]).
Flag(FlagType, &'a str)

A generic, non-defined, or unknown flag.

Warning(TOSECWarn<'a>)

Indicates an unexpected deviations from the TOSEC Naming convention.

Warnings may be lexical (appearing in the input string) or non-lexical, depending on the warning.

Warnings are always associated with the token following the warning in the resulting TOSECName token stream.

This also means that lexical warnings occur in the order of appearance in the input string.

Trait Implementations

impl<'a> Clone for TOSECToken<'a>[src]

impl<'a> Debug for TOSECToken<'a>[src]

impl<'a> Eq for TOSECToken<'a>[src]

impl<'a> Ord for TOSECToken<'a>[src]

impl PartialEq<TOSECToken<'_>> for TOSECToken<'_>[src]

impl PartialOrd<TOSECToken<'_>> for TOSECToken<'_>[src]

impl<'a> StructuralEq for TOSECToken<'a>[src]

impl<'a> TokenizedName<'a, TOSECToken<'a>> for TOSECName<'a>[src]

Auto Trait Implementations

impl<'a> RefUnwindSafe for TOSECToken<'a>

impl<'a> Send for TOSECToken<'a>

impl<'a> Sync for TOSECToken<'a>

impl<'a> Unpin for TOSECToken<'a>

impl<'a> UnwindSafe for TOSECToken<'a>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Conv for T

impl<T> Conv for T

impl<Q, K> Equivalent<K> for Q where
    K: Borrow<Q> + ?Sized,
    Q: Eq + ?Sized
[src]

impl<T> FmtForward for T

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Pipe for T where
    T: ?Sized

impl<T> Pipe for T

impl<T> PipeAsRef for T

impl<T> PipeBorrow for T

impl<T> PipeDeref for T

impl<T> PipeRef for T

impl<T> Tap for T

impl<T> Tap for T

impl<T, U> TapAsRef<U> for T where
    U: ?Sized

impl<T, U> TapBorrow<U> for T where
    U: ?Sized

impl<T> TapDeref for T

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> TryConv for T

impl<T> TryConv for T

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.