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 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 moreAuto Trait Implementations§
impl Freeze for ParentalLock
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
§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)