Struct ctru::applets::swkbd::ParentalLock
source · pub struct ParentalLock { /* private fields */ }
Expand description
Configuration structure to setup the Parental Lock applet.
Internally, the Parental Lock is just a different kind of SoftwareKeyboard
.
Implementations§
source§impl ParentalLock
impl ParentalLock
sourcepub fn new() -> Self
pub fn new() -> Self
Initialize a new configuration for the Parental Lock applet.
§Example
use ctru::applets::swkbd::ParentalLock;
let parental_lock = ParentalLock::new();
sourcepub fn launch(&mut self, _apt: &Apt, _gfx: &Gfx) -> Result<(), Error>
pub fn launch(&mut self, _apt: &Apt, _gfx: &Gfx) -> Result<(), Error>
Launch the Parental Lock applet based on the configuration and return a result depending on whether the operation was successful or not.
§Example
use ctru::applets::swkbd::{ParentalLock, Error};
let mut parental_lock = ParentalLock::new();
match parental_lock.launch(&apt, &gfx) {
Ok(_) => println!("You can access parental-only features and settings."),
Err(Error::ParentalFail) => println!("Is a kid trying to access this?"),
Err(_) => println!("Something wrong happened during the parental lock prompt.")
}
Trait Implementations§
source§impl Clone for ParentalLock
impl Clone for ParentalLock
source§fn clone(&self) -> ParentalLock
fn clone(&self) -> ParentalLock
Returns a copy 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 moreAuto Trait Implementations§
impl RefUnwindSafe for ParentalLock
impl !Send for ParentalLock
impl !Sync for ParentalLock
impl Unpin for ParentalLock
impl UnwindSafe for ParentalLock
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