pub struct Etymology {
pub word: String,
pub label: String,
pub etymology: String,
}
Expand description
An etymology as retrieved from EtymOnline.com.
Fields§
§word: String
The search term used for looking up an entry.
label: String
Container for the word, along with its part of speech, from the entry.
etymology: String
The entry as retrieved from EtymOnline.com. Currently this content is formatted for terminal output, including bold and italics.
Implementations§
Source§impl Etymology
impl Etymology
Sourcepub fn new(word: &str) -> Result<Self>
pub fn new(word: &str) -> Result<Self>
Performs a lookup via EtymOnline.com for the given word. Fallible, as it can fail via network error, or simply not find an entry. Error types are non-specific for simplicity’s sake.
Sourcepub fn beautify(etym_html: &str) -> Result<String>
pub fn beautify(etym_html: &str) -> Result<String>
Substitute HTML formatting for italics with terminal escape codes. Does NOT intelligently determine whether terminal is interactive.
Sourcepub fn extract_etymology_html(raw_html: &str) -> Result<String>
pub fn extract_etymology_html(raw_html: &str) -> Result<String>
From raw HTML results of query, excise just the first definition found.
Sourcepub fn extract_word_name(raw_html: &str) -> Result<String>
pub fn extract_word_name(raw_html: &str) -> Result<String>
Extract the entry name, e.g. Viking (n.)
Auto Trait Implementations§
impl Freeze for Etymology
impl RefUnwindSafe for Etymology
impl Send for Etymology
impl Sync for Etymology
impl Unpin for Etymology
impl UnwindSafe for Etymology
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