pub struct Backend { /* private fields */ }
Expand description
State of the application.
Trait Implementations§
Source§impl HangmanBackend for Backend
impl HangmanBackend for Backend
Source§fn new(config: &str) -> Result<Self, ConfigParseError>
fn new(config: &str) -> Result<Self, ConfigParseError>
Initialize the application with config data and start the first game.
Source§fn process_user_input(&mut self, inp: &str)
fn process_user_input(&mut self, inp: &str)
The user_input is a key stroke. The meaning depends on the game’s state:
Source§fn render_image(&self) -> String
fn render_image(&self) -> String
Renders the image. Make sure it is up to date with
self.image.update()
.Source§fn get_image_dimension(&self) -> (u8, u8)
fn get_image_dimension(&self) -> (u8, u8)
Forward the private image dimension
Source§fn render_secret(&self) -> String
fn render_secret(&self) -> String
Renders the partly hidden secret.
Source§fn render_game_lifes(&self) -> String
fn render_game_lifes(&self) -> String
Informs about some game statistics: lifes
Source§fn render_game_last_guess(&self) -> String
fn render_game_last_guess(&self) -> String
Informs about some game statistics: last guess
Source§fn render_instructions(&self) -> String
fn render_instructions(&self) -> String
Tells the user what to do next.
Auto Trait Implementations§
impl Freeze for Backend
impl RefUnwindSafe for Backend
impl Send for Backend
impl Sync for Backend
impl Unpin for Backend
impl UnwindSafe for Backend
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