pub struct Entry {
pub id: String,
pub kanji: Vec<KanjiEntry>,
pub kana: Vec<KanaEntry>,
pub sense: Vec<SenseEntry>,
}Fields§
§id: String§kanji: Vec<KanjiEntry>§kana: Vec<KanaEntry>§sense: Vec<SenseEntry>Implementations§
Source§impl Entry
impl Entry
Sourcepub fn primary_kanji(&self) -> Option<&str>
pub fn primary_kanji(&self) -> Option<&str>
The first kanji writing, if any. Many entries (kana-only words, names)
have no kanji form, so callers should not assume kanji[0] exists.
Sourcepub fn primary_kana(&self) -> Option<&str>
pub fn primary_kana(&self) -> Option<&str>
The first kana reading. Every JMdict entry has at least one kana
reading, but the field is technically a Vec, so this returns Option
to stay honest about the data model.
Sourcepub fn headword(&self) -> Option<&str>
pub fn headword(&self) -> Option<&str>
The preferred headword for display: kanji if present, otherwise kana.
Sourcepub fn glosses<'a>(
&'a self,
lang: &'a str,
) -> impl Iterator<Item = &'a str> + 'a
pub fn glosses<'a>( &'a self, lang: &'a str, ) -> impl Iterator<Item = &'a str> + 'a
Iterate over every gloss matching lang (e.g. "eng"), across all senses.
Sourcepub fn parts_of_speech(&self) -> Vec<&str>
pub fn parts_of_speech(&self) -> Vec<&str>
Every distinct part-of-speech tag across all senses, preserving first-seen order.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Entry
impl<'de> Deserialize<'de> for Entry
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for Entry
impl RefUnwindSafe for Entry
impl Send for Entry
impl Sync for Entry
impl Unpin for Entry
impl UnsafeUnpin for Entry
impl UnwindSafe for Entry
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more