use crate::Guid;
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct Unix {
pub r#type: UnixType,
pub guid: Option<Guid>,
}
impl Unix {
pub fn is_connectable(&self) -> bool {
self.r#type.is_connectable()
}
pub fn is_listenable(&self) -> bool {
self.r#type.is_listenable()
}
}
#[derive(Debug, Clone, PartialEq, Eq)]
pub enum UnixType {
Path(String),
Dir(String),
Tmpdir(String),
Abstract(String),
Runtime,
}
impl UnixType {
pub fn is_connectable(&self) -> bool {
match self {
UnixType::Path(_) => true,
UnixType::Dir(_) => false,
UnixType::Tmpdir(_) => false,
UnixType::Abstract(_) => true,
UnixType::Runtime => false,
}
}
pub fn is_listenable(&self) -> bool {
true
}
}