#![doc = include_str!("readme.md")]
#[derive(Clone, Debug)]
pub struct WitRoot {
pub items: Vec<WitItem>,
}
#[derive(Clone, Debug)]
pub enum WitItem {
Package(WitPackage),
World(WitWorld),
Interface(WitInterface),
}
#[derive(Clone, Debug)]
pub struct WitPackage {
pub name: String,
}
#[derive(Clone, Debug)]
pub struct WitWorld {
pub name: String,
pub items: Vec<WitWorldItem>,
}
#[derive(Clone, Debug)]
pub enum WitWorldItem {
Import(WitImport),
Export(WitExport),
Include(WitInclude),
}
#[derive(Clone, Debug)]
pub struct WitInterface {
pub name: String,
pub items: Vec<WitInterfaceItem>,
}
#[derive(Clone, Debug)]
pub enum WitInterfaceItem {
Type(WitType),
Func(WitFunc),
}
#[derive(Clone, Debug)]
pub struct WitFunc {
pub name: String,
pub params: Vec<WitParam>,
pub result: Option<WitTypeKind>,
}
#[derive(Clone, Debug)]
pub struct WitParam {
pub name: String,
pub ty: WitTypeKind,
}
#[derive(Clone, Debug)]
pub struct WitType {
pub name: String,
pub kind: WitTypeKind,
}
#[derive(Clone, Debug)]
pub enum WitTypeKind {
Bool,
U32,
String,
}
#[derive(Clone, Debug)]
pub struct WitImport {
pub name: String,
}
#[derive(Clone, Debug)]
pub struct WitExport {
pub name: String,
}
#[derive(Clone, Debug)]
pub struct WitInclude {
pub name: String,
}