1
0
Fork 0
forked from AbleOS/ableos
ableos/kernel/src/ipc/protocol.rs

41 lines
800 B
Rust
Raw Normal View History

2024-03-22 05:13:17 -05:00
use {
alloc::{string::String, vec::Vec},
hashbrown::HashMap,
log::info,
};
pub struct Type {}
pub struct Funct {
takes: Vec<String>,
gives: Vec<String>,
}
pub struct Protocol {
types: HashMap<String, Type>,
fns: HashMap<String, Funct>,
}
impl Protocol {
pub fn void() -> Self {
Self {
types: HashMap::new(),
fns: HashMap::new(),
}
}
// Check if a protocol defines all types it needs too
fn validate_protocol() -> bool {
false
}
}
impl From<String> for Protocol {
fn from(value: alloc::string::String) -> Self {
if value.starts_with("protocol") {
info!("ABC");
}
Self {
types: HashMap::new(),
fns: HashMap::new(),
}
}
}