pub struct Translation {
pub local: String,
pub foreign: String,
pub guesses_local_total: i32,
pub guesses_local_correct: i32,
pub guesses_foreign_total: i32,
pub guesses_foreign_correct: i32,
}
Fields§
§local: String
§foreign: String
§guesses_local_total: i32
§guesses_local_correct: i32
§guesses_foreign_total: i32
§guesses_foreign_correct: i32
Implementations§
Source§impl Translation
impl Translation
pub fn new(local: &str, foreign: &str) -> Translation
pub fn get_total_percent(&self) -> f64
pub fn guess_local(&mut self, guess: &str) -> bool
pub fn guess_foreign(&mut self, guess: &str) -> bool
pub fn reconcile( self, other: Translation, ) -> Result<Translation, VocabStoreError>
Trait Implementations§
Source§impl Debug for Translation
impl Debug for Translation
Source§impl Default for Translation
impl Default for Translation
Source§fn default() -> Translation
fn default() -> Translation
Returns the “default value” for a type. Read more
Source§impl PartialEq for Translation
impl PartialEq for Translation
Source§impl<__DB: Backend, __ST> Queryable<__ST, __DB> for Translation
impl<__DB: Backend, __ST> Queryable<__ST, __DB> for Translation
impl StructuralPartialEq for Translation
Auto Trait Implementations§
impl Freeze for Translation
impl RefUnwindSafe for Translation
impl Send for Translation
impl Sync for Translation
impl Unpin for Translation
impl UnwindSafe for Translation
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