pub struct DbDictionary { /* private fields */ }Implementations§
Source§impl DbDictionary
impl DbDictionary
pub fn new(db_url: String, lang: &str) -> DbDictionary
Trait Implementations§
Source§impl Dictionary for DbDictionary
impl Dictionary for DbDictionary
Source§fn get_random_word(&self) -> Option<DictionaryEntry>
fn get_random_word(&self) -> Option<DictionaryEntry>
Return a randomly selected word that has not been used before. If found, the database entry will be updated with a chrono::NaiveDate matching today.
Source§fn find_word(&self, text: &str) -> Option<DictionaryEntry>
fn find_word(&self, text: &str) -> Option<DictionaryEntry>
Find dictionary entry with matching [text]. Language is implicitly set in DbDictionary.
Source§fn create_word(&self, word_entry: DictionaryEntry) -> Option<DictionaryEntry>
fn create_word(&self, word_entry: DictionaryEntry) -> Option<DictionaryEntry>
Add new dictionary entry
Source§fn guessed_word(&self, word_entry: DictionaryEntry)
fn guessed_word(&self, word_entry: DictionaryEntry)
Mark word as guessed in the database when the player won
Auto Trait Implementations§
impl !Freeze for DbDictionary
impl !RefUnwindSafe for DbDictionary
impl Send for DbDictionary
impl !Sync for DbDictionary
impl Unpin for DbDictionary
impl UnwindSafe for DbDictionary
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
Source§impl<T> IntoSql for T
impl<T> IntoSql for T
Source§fn into_sql<T>(self) -> Self::Expressionwhere
Self: Sized + AsExpression<T>,
fn into_sql<T>(self) -> Self::Expressionwhere
Self: Sized + AsExpression<T>,
Convert
self to an expression for Diesel’s query builder. Read moreSource§fn as_sql<'a, T>(&'a self) -> <&'a Self as AsExpression<T>>::Expressionwhere
&'a Self: AsExpression<T>,
fn as_sql<'a, T>(&'a self) -> <&'a Self as AsExpression<T>>::Expressionwhere
&'a Self: AsExpression<T>,
Convert
&self to an expression for Diesel’s query builder. Read more