pub enum Field {
Show 17 variants Game(Option<String>), Cover(Option<String>), Engine(Option<String>), Setup(Option<String>), Runtime(Option<String>), Hints(Option<String>), Dev(Option<String>), Publi(Option<String>), Version(Option<String>), Status(Option<String>), Store(Option<Vec<String>>), Genres(Option<Vec<String>>), Tags(Option<Vec<String>>), Year(Option<String>), Added(Option<String>), Updated(Option<String>), Unknown(Option<String>),
}
Expand description

The Field enum is a representations of a line in the database. Each type of line is represented by a variant (see below). The Unknown variant is used to represent lines that were not parsed correctly.

Variants§

§

Game(Option<String>)

Store the result of a Game line of the database

§

Cover(Option<String>)

Store the result of a Cover line of the database

§

Engine(Option<String>)

Store the result of a Engine line of the database

§

Setup(Option<String>)

Store the result of a Setup line of the database

§

Runtime(Option<String>)

Store the result of a Runtime line of the database

§

Hints(Option<String>)

Store the result of a Hints line of the database

§

Dev(Option<String>)

Store the result of a Dev line of the database

§

Publi(Option<String>)

Store the result of a Pub line of the database

§

Version(Option<String>)

Store the result of a Version line of the database

§

Status(Option<String>)

Store the result of a Status line of the database

§

Store(Option<Vec<String>>)

Store the result of a Store line of the database Stores are stored in a vector

§

Genres(Option<Vec<String>>)

Store the result of a Genre line of the database Genres are stored in a vector

§

Tags(Option<Vec<String>>)

Store the result of a Tag line of the database Tags are stored in a vector

§

Year(Option<String>)

Store the result of a Year line of the database

§

Added(Option<String>)

When the game was added

§

Updated(Option<String>)

When the game was last updated

§

Unknown(Option<String>)

Store the result of a unknown line of the database The left hand side and the right hand side (if any) are stores separately.

Implementations§

source§

impl Field

source

pub fn from(line: &str) -> Self

Convert a line of the database into a Field enum (see exemple above).

Trait Implementations§

source§

impl Clone for Field

source§

fn clone(&self) -> Field

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 Debug for Field

source§

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

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

impl Display for Field

source§

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

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

impl PartialEq<Field> for Field

source§

fn eq(&self, other: &Field) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

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

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Eq for Field

source§

impl StructuralEq for Field

source§

impl StructuralPartialEq for Field

Auto Trait Implementations§

§

impl RefUnwindSafe for Field

§

impl Send for Field

§

impl Sync for Field

§

impl Unpin for Field

§

impl UnwindSafe for Field

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

const: unstable · source§

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

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

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

const: unstable · 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 Twhere T: Clone,

§

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> ToString for Twhere T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

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

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

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

Performs the conversion.
source§

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

§

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

The type returned in the event of a conversion error.
const: unstable · source§

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

Performs the conversion.