use super::{TypeKind, TypeNode, TypeNodeReg};
pub static TYPE_ANY: TypeNode = TypeNode {
id: "any",
parent: None,
kind: TypeKind::Abstract,
ffi_name: "",
wire_hash: 0,
denotation: "",
};
pub static TYPE_TENSOR: TypeNode = TypeNode {
id: "tensor",
parent: Some("any"),
kind: TypeKind::Abstract,
ffi_name: "",
wire_hash: 0,
denotation: "",
};
pub static TYPE_TENSOR_F32: TypeNode = TypeNode {
id: "tensor.f32",
parent: Some("tensor"),
kind: TypeKind::Concrete,
ffi_name: "bb_tensor_f32_t",
wire_hash: 0x0000_0000_0000_0101,
denotation: "ai.bytesandbrains.tensor.f32",
};
pub static TYPE_TENSOR_F64: TypeNode = TypeNode {
id: "tensor.f64",
parent: Some("tensor"),
kind: TypeKind::Concrete,
ffi_name: "bb_tensor_f64_t",
wire_hash: 0x0000_0000_0000_0102,
denotation: "ai.bytesandbrains.tensor.f64",
};
pub static TYPE_TENSOR_F16: TypeNode = TypeNode {
id: "tensor.f16",
parent: Some("tensor"),
kind: TypeKind::Concrete,
ffi_name: "bb_tensor_f16_t",
wire_hash: 0x0000_0000_0000_0103,
denotation: "ai.bytesandbrains.tensor.f16",
};
pub static TYPE_TENSOR_U8: TypeNode = TypeNode {
id: "tensor.u8",
parent: Some("tensor"),
kind: TypeKind::Concrete,
ffi_name: "bb_tensor_u8_t",
wire_hash: 0x0000_0000_0000_0104,
denotation: "ai.bytesandbrains.tensor.u8",
};
pub static TYPE_TENSOR_I32: TypeNode = TypeNode {
id: "tensor.i32",
parent: Some("tensor"),
kind: TypeKind::Concrete,
ffi_name: "bb_tensor_i32_t",
wire_hash: 0x0000_0000_0000_0105,
denotation: "ai.bytesandbrains.tensor.i32",
};
pub static TYPE_TENSOR_BOOL: TypeNode = TypeNode {
id: "tensor.bool",
parent: Some("tensor"),
kind: TypeKind::Concrete,
ffi_name: "bb_tensor_bool_t",
wire_hash: 0x0000_0000_0000_0106,
denotation: "ai.bytesandbrains.tensor.bool",
};
pub static TYPE_TENSOR_BF16: TypeNode = TypeNode {
id: "tensor.bf16",
parent: Some("tensor"),
kind: TypeKind::Concrete,
ffi_name: "bb_tensor_bf16_t",
wire_hash: 0x0000_0000_0000_0107,
denotation: "ai.bytesandbrains.tensor.bf16",
};
pub static TYPE_TENSOR_I8: TypeNode = TypeNode {
id: "tensor.i8",
parent: Some("tensor"),
kind: TypeKind::Concrete,
ffi_name: "bb_tensor_i8_t",
wire_hash: 0x0000_0000_0000_0108,
denotation: "ai.bytesandbrains.tensor.i8",
};
pub static TYPE_TENSOR_I16: TypeNode = TypeNode {
id: "tensor.i16",
parent: Some("tensor"),
kind: TypeKind::Concrete,
ffi_name: "bb_tensor_i16_t",
wire_hash: 0x0000_0000_0000_0109,
denotation: "ai.bytesandbrains.tensor.i16",
};
pub static TYPE_TENSOR_I64: TypeNode = TypeNode {
id: "tensor.i64",
parent: Some("tensor"),
kind: TypeKind::Concrete,
ffi_name: "bb_tensor_i64_t",
wire_hash: 0x0000_0000_0000_010A,
denotation: "ai.bytesandbrains.tensor.i64",
};
pub static TYPE_TENSOR_U16: TypeNode = TypeNode {
id: "tensor.u16",
parent: Some("tensor"),
kind: TypeKind::Concrete,
ffi_name: "bb_tensor_u16_t",
wire_hash: 0x0000_0000_0000_010B,
denotation: "ai.bytesandbrains.tensor.u16",
};
pub static TYPE_TENSOR_U32: TypeNode = TypeNode {
id: "tensor.u32",
parent: Some("tensor"),
kind: TypeKind::Concrete,
ffi_name: "bb_tensor_u32_t",
wire_hash: 0x0000_0000_0000_010C,
denotation: "ai.bytesandbrains.tensor.u32",
};
pub static TYPE_TENSOR_U64: TypeNode = TypeNode {
id: "tensor.u64",
parent: Some("tensor"),
kind: TypeKind::Concrete,
ffi_name: "bb_tensor_u64_t",
wire_hash: 0x0000_0000_0000_010D,
denotation: "ai.bytesandbrains.tensor.u64",
};
pub static TYPE_SCALAR: TypeNode = TypeNode {
id: "scalar",
parent: Some("any"),
kind: TypeKind::Abstract,
ffi_name: "",
wire_hash: 0,
denotation: "",
};
pub static TYPE_SCALAR_F32: TypeNode = TypeNode {
id: "scalar.f32",
parent: Some("scalar"),
kind: TypeKind::Concrete,
ffi_name: "bb_f32_t",
wire_hash: 0x0000_0000_0000_0201,
denotation: "bb.f32",
};
pub static TYPE_SCALAR_F64: TypeNode = TypeNode {
id: "scalar.f64",
parent: Some("scalar"),
kind: TypeKind::Concrete,
ffi_name: "bb_f64_t",
wire_hash: 0x0000_0000_0000_0202,
denotation: "bb.f64",
};
pub static TYPE_SCALAR_F16: TypeNode = TypeNode {
id: "scalar.f16",
parent: Some("scalar"),
kind: TypeKind::Concrete,
ffi_name: "bb_f16_t",
wire_hash: 0x0000_0000_0000_0203,
denotation: "bb.f16",
};
pub static TYPE_SCALAR_U8: TypeNode = TypeNode {
id: "scalar.u8",
parent: Some("scalar"),
kind: TypeKind::Concrete,
ffi_name: "bb_u8_t",
wire_hash: 0x0000_0000_0000_0204,
denotation: "bb.u8",
};
pub static TYPE_SCALAR_I32: TypeNode = TypeNode {
id: "scalar.i32",
parent: Some("scalar"),
kind: TypeKind::Concrete,
ffi_name: "bb_i32_t",
wire_hash: 0x0000_0000_0000_0205,
denotation: "bb.i32",
};
pub static TYPE_PEER_ID: TypeNode = TypeNode {
id: "peer_id",
parent: Some("any"),
kind: TypeKind::Concrete,
ffi_name: "bb_peer_id_t",
wire_hash: 0x0000_0000_0000_0010,
denotation: "bb.peer_id",
};
pub static TYPE_PEER_ID_VEC: TypeNode = TypeNode {
id: "peer_id_vec",
parent: Some("any"),
kind: TypeKind::Concrete,
ffi_name: "bb_peer_id_vec_t",
wire_hash: 0x0000_0000_0000_0012,
denotation: "bb.peer_id_vec",
};
pub static TYPE_TRIGGER: TypeNode = TypeNode {
id: "trigger",
parent: Some("any"),
kind: TypeKind::Concrete,
ffi_name: "bb_trigger_t",
wire_hash: 0x0000_0000_0000_000A,
denotation: "bb.trigger",
};
pub static TYPE_BYTES: TypeNode = TypeNode {
id: "bytes",
parent: Some("any"),
kind: TypeKind::Concrete,
ffi_name: "bb_bytes_t",
wire_hash: 0x0000_0000_0000_000B,
denotation: "ai.bytesandbrains.opaque",
};
pub static TYPE_WIRE_REQ_ID: TypeNode = TypeNode {
id: "wire_req_id",
parent: Some("any"),
kind: TypeKind::Concrete,
ffi_name: "bb_wire_req_id_t",
wire_hash: 0x0000_0000_0000_0011,
denotation: "bb.wire_req_id",
};
pub static TYPE_MULTIADDRESS: TypeNode = TypeNode {
id: "multiaddress",
parent: Some("any"),
kind: TypeKind::Concrete,
ffi_name: "bb_multiaddress_t",
wire_hash: 0x0000_0000_0000_0301,
denotation: "ai.bytesandbrains.multiaddress",
};
pub static TYPE_ADDRESS_VEC: TypeNode = TypeNode {
id: "address_vec",
parent: Some("any"),
kind: TypeKind::Concrete,
ffi_name: "bb_address_vec_t",
wire_hash: 0x0000_0000_0000_0303,
denotation: "ai.bytesandbrains.address_vec",
};
pub static TYPE_COMPOSITE: TypeNode = TypeNode {
id: "composite",
parent: Some("any"),
kind: TypeKind::Concrete,
ffi_name: "bb_composite_t",
wire_hash: 0x0000_0000_0000_0302,
denotation: "ai.bytesandbrains.composite",
};
inventory::submit! { TypeNodeReg(&TYPE_ANY) }
inventory::submit! { TypeNodeReg(&TYPE_TENSOR) }
inventory::submit! { TypeNodeReg(&TYPE_TENSOR_F32) }
inventory::submit! { TypeNodeReg(&TYPE_TENSOR_F64) }
inventory::submit! { TypeNodeReg(&TYPE_TENSOR_F16) }
inventory::submit! { TypeNodeReg(&TYPE_TENSOR_U8) }
inventory::submit! { TypeNodeReg(&TYPE_TENSOR_I32) }
inventory::submit! { TypeNodeReg(&TYPE_TENSOR_BOOL) }
inventory::submit! { TypeNodeReg(&TYPE_TENSOR_BF16) }
inventory::submit! { TypeNodeReg(&TYPE_TENSOR_I8) }
inventory::submit! { TypeNodeReg(&TYPE_TENSOR_I16) }
inventory::submit! { TypeNodeReg(&TYPE_TENSOR_I64) }
inventory::submit! { TypeNodeReg(&TYPE_TENSOR_U16) }
inventory::submit! { TypeNodeReg(&TYPE_TENSOR_U32) }
inventory::submit! { TypeNodeReg(&TYPE_TENSOR_U64) }
inventory::submit! { TypeNodeReg(&TYPE_SCALAR) }
inventory::submit! { TypeNodeReg(&TYPE_SCALAR_F32) }
inventory::submit! { TypeNodeReg(&TYPE_SCALAR_F64) }
inventory::submit! { TypeNodeReg(&TYPE_SCALAR_F16) }
inventory::submit! { TypeNodeReg(&TYPE_SCALAR_U8) }
inventory::submit! { TypeNodeReg(&TYPE_SCALAR_I32) }
inventory::submit! { TypeNodeReg(&TYPE_PEER_ID) }
inventory::submit! { TypeNodeReg(&TYPE_PEER_ID_VEC) }
inventory::submit! { TypeNodeReg(&TYPE_TRIGGER) }
inventory::submit! { TypeNodeReg(&TYPE_BYTES) }
inventory::submit! { TypeNodeReg(&TYPE_WIRE_REQ_ID) }
inventory::submit! { TypeNodeReg(&TYPE_MULTIADDRESS) }
inventory::submit! { TypeNodeReg(&TYPE_ADDRESS_VEC) }
inventory::submit! { TypeNodeReg(&TYPE_COMPOSITE) }
pub fn lookup_denotation(denotation: &str) -> Option<&'static TypeNode> {
match denotation {
"ai.bytesandbrains.tensor.f32" => Some(&TYPE_TENSOR_F32),
"ai.bytesandbrains.tensor.f64" => Some(&TYPE_TENSOR_F64),
"ai.bytesandbrains.tensor.f16" => Some(&TYPE_TENSOR_F16),
"ai.bytesandbrains.tensor.u8" => Some(&TYPE_TENSOR_U8),
"ai.bytesandbrains.tensor.i32" => Some(&TYPE_TENSOR_I32),
"ai.bytesandbrains.tensor.bool" => Some(&TYPE_TENSOR_BOOL),
"ai.bytesandbrains.tensor.bf16" => Some(&TYPE_TENSOR_BF16),
"ai.bytesandbrains.tensor.i8" => Some(&TYPE_TENSOR_I8),
"ai.bytesandbrains.tensor.i16" => Some(&TYPE_TENSOR_I16),
"ai.bytesandbrains.tensor.i64" => Some(&TYPE_TENSOR_I64),
"ai.bytesandbrains.tensor.u16" => Some(&TYPE_TENSOR_U16),
"ai.bytesandbrains.tensor.u32" => Some(&TYPE_TENSOR_U32),
"ai.bytesandbrains.tensor.u64" => Some(&TYPE_TENSOR_U64),
"bb.f32" => Some(&TYPE_SCALAR_F32),
"bb.f64" => Some(&TYPE_SCALAR_F64),
"bb.f16" => Some(&TYPE_SCALAR_F16),
"bb.u8" => Some(&TYPE_SCALAR_U8),
"bb.i32" => Some(&TYPE_SCALAR_I32),
"bb.peer_id" => Some(&TYPE_PEER_ID),
"bb.peer_id_vec" => Some(&TYPE_PEER_ID_VEC),
"bb.trigger" => Some(&TYPE_TRIGGER),
"bb.wire_req_id" => Some(&TYPE_WIRE_REQ_ID),
"ai.bytesandbrains.multiaddress" => Some(&TYPE_MULTIADDRESS),
"ai.bytesandbrains.address_vec" => Some(&TYPE_ADDRESS_VEC),
"ai.bytesandbrains.composite" => Some(&TYPE_COMPOSITE),
"ai.bytesandbrains.opaque" => Some(&TYPE_BYTES),
_ => None,
}
}