use std::fmt;
use crate::term::Term;
#[derive(Copy, Clone, Debug, Eq, PartialEq)]
pub enum GroupLeaderError {
NoProc,
}
impl fmt::Display for GroupLeaderError {
fn fmt(&self, formatter: &mut fmt::Formatter<'_>) -> fmt::Result {
match self {
Self::NoProc => formatter.write_str("target process does not exist"),
}
}
}
impl std::error::Error for GroupLeaderError {}
pub trait GroupLeaderFacility: Send + Sync {
fn set_group_leader(&self, pid: u64, leader: Term) -> Result<(), GroupLeaderError>;
fn group_leader(&self, pid: u64) -> Result<Term, GroupLeaderError>;
}