Struct shiratsu_naming::naming::tosec::TOSECName[][src]

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

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().


impl TOSECName<'_>[src]

pub fn without_trailing(self) -> Self[src]

Removes any trailing unparsed string segments from the name.

pub fn into_strict(self) -> Self[src]

Makes the name conform strictly to the TOSEC naming conventions.

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


  • 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

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

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

impl Display for TOSECName<'_>[src]

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

impl<'a> From<Vec<TOSECToken<'a>, Global>> for TOSECName<'a>[src]

impl<'a> PartialEq<TOSECName<'a>> for TOSECName<'a>[src]

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

impl<'a> StructuralPartialEq for TOSECName<'a>[src]

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

Auto Trait Implementations

impl<'a> RefUnwindSafe for TOSECName<'a>

impl<'a> Send for TOSECName<'a>

impl<'a> Sync for TOSECName<'a>

impl<'a> Unpin for TOSECName<'a>

impl<'a> UnwindSafe for TOSECName<'a>

Blanket Implementations

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

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

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

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

impl<T> FmtForward for T

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

impl<T, U> Into<U> for T where
    U: From<T>, 

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

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized

impl<T> TryConv for T

impl<T> TryConv for T

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 

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

The type returned in the event of a conversion error.