pub struct LoginScreen {
pub username_buffer: String,
pub password_buffer: String,
pub error_message: String,
pub state: LoginField,
/* private fields */
}Expand description
Login screen state.
Fields§
§username_buffer: StringUsername input buffer (max 32 chars).
password_buffer: StringPassword input buffer (max 64 chars).
error_message: StringError message (e.g. “Invalid credentials”).
state: LoginFieldCurrent field/state.
Implementations§
Source§impl LoginScreen
impl LoginScreen
Sourcepub fn handle_key(&mut self, key: u8) -> bool
pub fn handle_key(&mut self, key: u8) -> bool
Handle a key press.
Returns true if the form is ready to submit (Enter on password field).
Sourcepub fn render(&mut self, buf: &mut [u32], width: u32, height: u32)
pub fn render(&mut self, buf: &mut [u32], width: u32, height: u32)
Render the login screen to a pixel buffer.
buf is width * height ARGB8888 pixels.
Sourcepub fn set_auth_result(&mut self, success: bool, message: &str)
pub fn set_auth_result(&mut self, success: bool, message: &str)
Set authentication result.
Sourcepub fn authenticate(&mut self) -> bool
pub fn authenticate(&mut self) -> bool
Attempt authentication using the security subsystem.
Trait Implementations§
Source§impl Clone for LoginScreen
impl Clone for LoginScreen
Source§fn clone(&self) -> LoginScreen
fn clone(&self) -> LoginScreen
Returns a duplicate of the value. Read more
1.0.0§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for LoginScreen
impl Debug for LoginScreen
Auto Trait Implementations§
impl Freeze for LoginScreen
impl RefUnwindSafe for LoginScreen
impl Send for LoginScreen
impl Sync for LoginScreen
impl Unpin for LoginScreen
impl UnwindSafe for LoginScreen
Blanket Implementations§
§impl<T> Any for Twhere
T: 'static + ?Sized,
impl<T> Any for Twhere
T: 'static + ?Sized,
§impl<T> Borrow<T> for Twhere
T: ?Sized,
impl<T> Borrow<T> for Twhere
T: ?Sized,
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit)