#[allow(unused_imports)]
use alloc::{boxed::Box, format, string::String, string::ToString, vec, vec::Vec};
use crate::ontology::Vocabulary;
use crate::ontology::meta::Provenance;
#[cfg(not(target_arch = "wasm32"))]
#[linkme::distributed_slice]
pub static VOCABULARIES: [fn() -> Vocabulary];
#[cfg(not(target_arch = "wasm32"))]
#[linkme::distributed_slice]
pub static AXIOMS: [fn() -> Provenance];
#[cfg(not(target_arch = "wasm32"))]
#[linkme::distributed_slice]
pub static FUNCTORS: [fn() -> Provenance];
#[cfg(not(target_arch = "wasm32"))]
#[linkme::distributed_slice]
pub static ADJUNCTIONS: [fn() -> Provenance];
#[cfg(not(target_arch = "wasm32"))]
#[linkme::distributed_slice]
pub static NATURAL_TRANSFORMATIONS: [fn() -> Provenance];
#[cfg(not(target_arch = "wasm32"))]
pub fn describe_knowledge_base() -> Vec<Vocabulary> {
VOCABULARIES.iter().map(|f| f()).collect()
}
#[cfg(target_arch = "wasm32")]
pub fn describe_knowledge_base() -> Vec<Vocabulary> {
Vec::new()
}
#[cfg(not(target_arch = "wasm32"))]
pub fn describe_axioms() -> Vec<Provenance> {
AXIOMS.iter().map(|f| f()).collect()
}
#[cfg(target_arch = "wasm32")]
pub fn describe_axioms() -> Vec<Provenance> {
Vec::new()
}
#[cfg(not(target_arch = "wasm32"))]
pub fn describe_functors() -> Vec<Provenance> {
FUNCTORS.iter().map(|f| f()).collect()
}
#[cfg(target_arch = "wasm32")]
pub fn describe_functors() -> Vec<Provenance> {
Vec::new()
}
#[cfg(not(target_arch = "wasm32"))]
pub fn describe_adjunctions() -> Vec<Provenance> {
ADJUNCTIONS.iter().map(|f| f()).collect()
}
#[cfg(target_arch = "wasm32")]
pub fn describe_adjunctions() -> Vec<Provenance> {
Vec::new()
}
#[cfg(not(target_arch = "wasm32"))]
pub fn describe_natural_transformations() -> Vec<Provenance> {
NATURAL_TRANSFORMATIONS.iter().map(|f| f()).collect()
}
#[cfg(target_arch = "wasm32")]
pub fn describe_natural_transformations() -> Vec<Provenance> {
Vec::new()
}
pub fn describe_all_arrows() -> Vec<Provenance> {
let mut arrows = describe_functors();
arrows.extend(describe_adjunctions());
arrows.extend(describe_natural_transformations());
arrows
}
#[cfg(all(test, not(target_arch = "wasm32")))]
mod tests {
use super::*;
#[test]
fn registry_is_accessible() {
let _ = describe_knowledge_base().len();
let _ = describe_axioms().len();
let _ = describe_functors().len();
let _ = describe_adjunctions().len();
let _ = describe_natural_transformations().len();
}
}