1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
//! SSLC (TLS) service.

// TODO: Implement remaining functions

use crate::error::ResultCode;

/// Handle to the SSLC service.
pub struct SslC(());

impl SslC {
    /// Initialize a new service handle.
    ///
    /// # Example
    ///
    /// ```
    /// # let _runner = test_runner::GdbRunner::default();
    /// # use std::error::Error;
    /// # fn main() -> Result<(), Box<dyn Error>> {
    /// #
    /// use ctru::services::sslc::SslC;
    ///
    /// let sslc = SslC::new()?;
    /// #
    /// # Ok(())
    /// # }
    /// ```
    #[doc(alias = "sslcInit")]
    pub fn new() -> crate::Result<Self> {
        unsafe {
            ResultCode(ctru_sys::sslcInit(0))?;
            Ok(SslC(()))
        }
    }
}

impl Drop for SslC {
    #[doc(alias = "sslcExit")]
    fn drop(&mut self) {
        unsafe { ctru_sys::sslcExit() };
    }
}