aboutsummaryrefslogtreecommitdiff
path: root/ctru-rs/src/srv.rs
blob: 3ec50a0aa27f7047ea25e87c1eee76e9d5d2b1ae (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
pub struct Srv(());

impl Srv {
    pub fn init() -> ::Result<Srv> {
        unsafe {
            let r = ::libctru::srvInit();
            if r < 0 {
                Err(r.into())
            } else {
                Ok(Srv(()))
            }
        }
    }
}

impl Drop for Srv {
    fn drop(&mut self) {
        unsafe { ::libctru::srvExit() };
    }
}