Enum TOSECWarn

Source
pub enum TOSECWarn<'a> {
Show 13 variants ZZZUnknown, MalformedDatePlaceholder(&'a str), MalformedDevelopmentStatus(&'a str), UndelimitedDate(&'a str), MissingDate, MissingPublisher, MissingSpace, UnexpectedSpace, ByPublisher, PublisherBeforeDate, GoodToolsRegionCode(&'a str), VersionInFlag, NotEof(&'a str),
}
Expand description

A token that represents a warning or inconsistency in a TOSEC Naming Convention file name.

Warnings may be lexical (and are emitted in the input stream), or non-lexical, which serves as a warning.

Warnings may modify how a token is re-serialized depending on the order they appear in the TOSECName. A warning always occurs before the associated token.

Variants§

§

ZZZUnknown

This file name starts with ZZZ-UNK-.

This warning is lexical and will emit the string ZZZ-UNK-

§

MalformedDatePlaceholder(&'a str)

The date placeholder in the following date token is malformed, often because it is upper cased.

A date such as 19XX will produce this warning.

If multiple date segments are malformed, multiple warnings will be emitted in the order year, month, date.

This warning is non-lexical.

§

MalformedDevelopmentStatus(&'a str)

The development status flag in the following development status token is malformed, often because it is upper cased.

A development status such as Beta will produce this warning.

This warning is non-lexical.

§

UndelimitedDate(&'a str)

The following date token is undelimited with hyphens.

A date such as 20001231 will produce this warning.

This warning is lexical and will modify the re-serialization of the following date token. This warning always occurs after all MalformedDatePlaceholder warnings.

§

MissingDate

The required date token is missing.

This warning is non-lexical.

§

MissingPublisher

The required publisher token is missing.

This warning is non-lexical.

§

MissingSpace

A space was expected between the preceding and following token of this warning.

This warning is lexical and will ensure that there are no spaces between the preceding and following non-warning token.

§

UnexpectedSpace

A space occurred between the preceding and following token of this warning.

This warning is lexical and will ensure that a space occurs between the preceding and following non-warning token.

§

ByPublisher

The following publisher token is preceded by the string ‘by’.

This may occur in ZZZ-UNK- names such as ZZZ-UNK-Micro Font Dumper by Schick, Bastian.

This warning is lexical and will emit the string by .

§

PublisherBeforeDate

The publisher flag occurred before the date flag.

This often occurs if a ByPublisher warning is emitted. If so, this token is always emitted before ByPublisher is emitted.

This warning is non-lexical.

§

GoodToolsRegionCode(&'a str)

A GoodTool region code occurred rather than an ISO region.

This warning is non-lexical, however the following region token will contain the GoodTools region string, and not a valid TOSEC ISO region string.

TOSECName::into_strict() will transform GoodTools region tokens into ISO region string tokens.

§

VersionInFlag

A version occurred wrap in parentheses as a flag.

This warning is lexical and will cause the following version token to be emitted within parentheses.

§

NotEof(&'a str)

When parsing a TOSEC name, the name is expected to be complete.

If not, then this warning will be emitted containing the remainder of the string. This often occurs because of unbalanced parentheses or braces.

If this warning is emitted, it should be the last token in the token string, and thus have no associated token.

This warning is lexical and will emit the remainder string segment. This can be removed with TOSECName::without_trailing.

Trait Implementations§

Source§

impl<'a> Clone for TOSECWarn<'a>

Source§

fn clone(&self) -> TOSECWarn<'a>

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<'a> Debug for TOSECWarn<'a>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'a> Ord for TOSECWarn<'a>

Source§

fn cmp(&self, other: &TOSECWarn<'a>) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · Source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · Source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · Source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized,

Restrict a value to a certain interval. Read more
Source§

impl<'a> PartialEq for TOSECWarn<'a>

Source§

fn eq(&self, other: &TOSECWarn<'a>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<'a> PartialOrd for TOSECWarn<'a>

Source§

fn partial_cmp(&self, other: &TOSECWarn<'a>) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · Source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · Source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · Source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · Source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl<'a> Eq for TOSECWarn<'a>

Source§

impl<'a> StructuralPartialEq for TOSECWarn<'a>

Auto Trait Implementations§

§

impl<'a> Freeze for TOSECWarn<'a>

§

impl<'a> RefUnwindSafe for TOSECWarn<'a>

§

impl<'a> Send for TOSECWarn<'a>

§

impl<'a> Sync for TOSECWarn<'a>

§

impl<'a> Unpin for TOSECWarn<'a>

§

impl<'a> UnwindSafe for TOSECWarn<'a>

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

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

Source§

fn equivalent(&self, key: &K) -> bool

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

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

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

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

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

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

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

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.