memlink_runtime/
exports.rs1pub const REQUIRED_EXPORTS: &[&str] = &[
4 "memlink_init",
5 "memlink_call",
6 "memlink_shutdown",
7];
8
9pub const OPTIONAL_EXPORTS: &[&str] = &[
10 "memlink_get_state_size",
11 "memlink_serialize_state",
12 "memlink_deserialize_state",
13];
14
15pub fn is_required_export(name: &str) -> bool {
16 REQUIRED_EXPORTS.contains(&name)
17}
18
19pub fn is_optional_export(name: &str) -> bool {
20 OPTIONAL_EXPORTS.contains(&name)
21}
22
23pub fn is_known_export(name: &str) -> bool {
24 is_required_export(name) || is_optional_export(name)
25}
26
27#[derive(Debug, Clone, Copy, PartialEq, Eq)]
28pub enum ExportCategory {
29 Required,
30 Optional,
31 Unknown,
32}
33
34pub fn categorize_export(name: &str) -> ExportCategory {
35 if is_required_export(name) {
36 ExportCategory::Required
37 } else if is_optional_export(name) {
38 ExportCategory::Optional
39 } else {
40 ExportCategory::Unknown
41 }
42}