define_struct! {
pub struct CommP {
inner: String,
}
}
use std::ops::Deref;
impl Deref for CommP {
type Target = String;
fn deref(&self) -> &Self::Target {
&self.inner
}
}
impl CommP {
pub fn into_inner(self) -> String {
self.inner
}
}
use std::str::FromStr;
impl FromStr for CommP {
type Err = crate::ProcErr;
fn from_str(s: &str) -> Result<CommP, crate::ProcErr> {
Ok(CommP{inner:s.to_string()})
}
}
pid_instance_impl! {
comm_of, "comm", CommP,
comm_self, comm_of_task, comm_self_task
}
#[cfg(test)]
mod test {
use super::*;
#[test]
fn test_comm_of() {
comm_self().unwrap();
}
}