pub struct Akinator {
pub language: Language,
pub theme: Theme,
pub child_mode: bool,
pub current_question: Option<String>,
pub progression: f32,
pub step: usize,
pub first_guess: Option<Guess>,
pub guesses: Vec<Guess>,
/* private fields */
}
Expand description
Represents an akinator game
Fields§
§language: Language
The language for the akinator session
theme: Theme
The theme for the akinator session
One of ‘Characters’, ‘Animals’, or ‘Objects’
child_mode: bool
indicates whether or not to filter out NSFW questions and content
current_question: Option<String>
returns the current question to answer
progression: f32
returns the progress of the akinator a float out of 100.0
step: usize
returns the a counter of questions asked and answered starts at 0
first_guess: Option<Guess>
returns the akinator’s best guess
Only will be set when Self::win
has been called
guesses: Vec<Guess>
a vec containing all the possible guesses by the akinator
Only will be set when Self::win
has been called
Implementations§
Source§impl Akinator
impl Akinator
Sourcepub const fn with_theme(self, theme: Theme) -> Self
pub const fn with_theme(self, theme: Theme) -> Self
builder method to set the [Self.theme
] for the akinator game
Sourcepub const fn with_language(self, language: Language) -> Self
pub const fn with_language(self, language: Language) -> Self
builder method to set the [Self.language
] for the akinator game
Sourcepub const fn with_child_mode(self) -> Self
pub const fn with_child_mode(self) -> Self
builder function to turn on [Self.child_mode
]
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Akinator
impl !RefUnwindSafe for Akinator
impl Send for Akinator
impl Sync for Akinator
impl Unpin for Akinator
impl !UnwindSafe for Akinator
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