Browse Source

Add docstring for PS module

pull/39/head
Ian Chamberlain 3 years ago
parent
commit
cb15f99486
No known key found for this signature in database
GPG Key ID: AE5484D09405AA60
  1. 8
      ctru-rs/src/services/ps.rs

8
ctru-rs/src/services/ps.rs

@ -1,7 +1,15 @@
//! Process Services (PS) module. This is used for miscellaneous utility tasks, but
//! is particularly important because it is used to generate random data, which
//! is required for common things like [`HashMap`](std::collections::HashMap).
//! See also <https://www.3dbrew.org/wiki/Process_Services>
/// PS handle. This must not be dropped in order for random generation
/// to work (in most cases, the lifetime of an application).
#[non_exhaustive] #[non_exhaustive]
pub struct Ps; pub struct Ps;
impl Ps { impl Ps {
/// Initialize the PS module.
pub fn init() -> crate::Result<Self> { pub fn init() -> crate::Result<Self> {
let r = unsafe { ctru_sys::psInit() }; let r = unsafe { ctru_sys::psInit() };
if r < 0 { if r < 0 {

Loading…
Cancel
Save