1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22

define_struct!{
    /// Represent the content of /proc/consoles, returned by [`consoles()`](fn.consoles.html)
    pub struct Consoles{
        consoles: String,
    }
}

use std::str::FromStr;
impl FromStr for Consoles {
    type Err = crate::ProcErr;

    fn from_str(s: &str) -> Result<Consoles, crate::ProcErr> {
        let consoles = s.trim().to_string();
        Ok(Consoles{consoles})
    }
}


instance_impl!(
    consoles, "/proc/consoles", Consoles
);