#[repr(transparent)]
pub struct TOSECName<'a>(_);
Expand description

A TOSEC format file name.

The order of tokens in a TOSECName is significant in order of appearance in the input file name.

They are also not guaranteed to be strictly conforming to the TOSEC naming convention, but can be made so using TOSECName::into_strict().

Implementations

Removes any trailing unparsed string segments from the name.

Makes the name conform strictly to the TOSEC naming conventions.

This removes any warning tokens and ensures the order of flags is proper.

Fixes
  • If there is no date, 19xx is added as the date.
  • If there is no publisher, the unknown publisher (-) is added.
  • GoodTools region codes are converted into the ISO equivalent.
  • Publishers are sorted lexicographically.
  • Tags are put in the order
    Title version (demo) (date)(publisher)(system)(video)(country)(language)
    (copyright status)(development status)(media type)(media label)
    [cr][f][h][m][p][t][tr][o][u][v][b][a][!][more info]
  • The date ‘19XX’ is changed into ‘19xx’.
  • Uppercased development tags are lowercased.
Zero-copy guarantee

This method consumes the tokenized name and remains zero-copy. The zero-copy nature of the parsed tokens mean that some fixes can not be done, such as reorganizing individual publisher names into Surname, Given Name format.

As a result, the strict name may not always conform to the strictest reading of the TOSEC naming convention, especially with regards to alphabetization or malformed flags that were not explicitly specified in listed fixes.

The fixes that are done are only possible by converting the tokenized &'a str into a known &'static str.

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

Formats the value using the given formatter. Read more

Converts to this type from the input type.

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Get the title of the tokenized name.

Returns an iterator over the tokens of this name.

Tries to parse the input string using the naming convention of this tokenized name. Read more

The naming convention of this tokenized name.

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

Compare self to key and return true if they are equal.

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

Converts the given value to a String. 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.