Trait jmdict_enums::Enum[][src]

pub trait Enum: Sized {
    fn code(&self) -> &'static str;
fn from_code(code: &str) -> Option<Self>;
fn constant_name(&self) -> &'static str; }

Common methods provided by all enums in this crate.

Required methods

fn code(&self) -> &'static str[src]

Returns the string that marks this enum variant in the JMdict. For values that JMdict represents as XML entities, only the entity name is returned, e.g. adj-n instead of &adj-n;.

fn from_code(code: &str) -> Option<Self>[src]

Parses a representation from the JMdict file into a value of this enum. This is the reverse of self.code(), i.e. Self::from_code(self.code()) == Some(self).

fn constant_name(&self) -> &'static str[src]

Returns the variant name. This is used to generate Rust code for this enum. The impl Display for enums uses this same representation.

Loading content...

Implementors

impl Enum for AllGlossLanguage[src]

impl Enum for AllPartOfSpeech[src]

impl Enum for Dialect[src]

impl Enum for GlossLanguage[src]

impl Enum for GlossType[src]

impl Enum for KanjiInfo[src]

impl Enum for PartOfSpeech[src]

impl Enum for ReadingInfo[src]

impl Enum for SenseInfo[src]

impl Enum for SenseTopic[src]

Loading content...