[][src]Struct datamuse_api_wrapper::WordElement

pub struct WordElement {
    pub word: String,
    pub score: usize,
    pub num_syllables: Option<usize>,
    pub parts_of_speech: Option<Vec<PartOfSpeech>>,
    pub pronunciation: Option<String>,
    pub frequency: Option<f32>,
    pub definitions: Option<Vec<Definition>>,
}

This struct represents each word and its associated data in the response. It is constructed when parsing a Response with the method list(). Note that all optional values can still be None even if the proper flag is set

Fields

word: String

The word returned based on the search parameters

score: usize

A score which ranks the word based on how well it fit the provided parameters. Note that by default the words are ranked by score from highest to lowest

num_syllables: Option<usize>

The number of syllables the word has. This will only have a value if the meta data flag SyllableCount is set

parts_of_speech: Option<Vec<PartOfSpeech>>

The part(s) of speech a word can be. This will only have a value if the meta data flag PartsOfSpeech is set

pronunciation: Option<String>

The pronunciation of the word. This will only have a value if the meta data flag Pronunciation is set. If an IPA pronuncation is available, it takes precedence as it is optional

frequency: Option<f32>

The frequency of a word based on how many times the word is used per 1,000,000 words of text. This will only have a value if the meta data flag WordFrequency is set

definitions: Option<Vec<Definition>>

Definitions of a word and the associated part of speech with its use. This will only have a value if the meta data flag Definitions is set

Trait Implementations

impl Debug for WordElement[src]

impl PartialEq<WordElement> for WordElement[src]

impl StructuralPartialEq for WordElement[src]

Auto Trait Implementations

Blanket Implementations

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

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

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

impl<T> Instrument for T[src]

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.