futilehdl/src/frontend/callable.rs

21 lines
360 B
Rust
Raw Normal View History

use super::types::Type;
2022-02-16 16:38:56 +00:00
#[derive(Copy, Clone, PartialEq)]
pub struct CallableId(u32);
2022-02-15 20:32:55 +00:00
pub struct Callable {
pub name: String,
2022-02-15 20:32:55 +00:00
pub args: Vec<(Option<String>, Type)>,
pub ret_type: Option<Type>,
}
2022-02-15 20:32:55 +00:00
impl<'ty> Callable {
pub fn name(&self) -> &str {
&self.name
}
pub fn argcount(&self) -> usize {
self.args.len()
}
}