Create a Rust API for part of //aos:configuration
Change-Id: I00044634f437e72487aaaca28e9a00fe65a4aa48
Signed-off-by: Brian Silverman <bsilver16384@gmail.com>
diff --git a/aos/configuration_for_rust.h b/aos/configuration_for_rust.h
new file mode 100644
index 0000000..ae18346
--- /dev/null
+++ b/aos/configuration_for_rust.h
@@ -0,0 +1,21 @@
+#ifndef AOS_CONFIGURATION_FOR_RUST_H_
+#define AOS_CONFIGURATION_FOR_RUST_H_
+
+#include "aos/configuration.h"
+#include "cxx.h"
+
+namespace aos::configuration {
+
+const Channel *GetChannelForRust(const Configuration *config, rust::Str name,
+ rust::Str type, rust::Str application_name,
+ const Node *node);
+
+// Returns a Configuration flatbuffer. Returns an empty vector on errors.
+// TODO: It would be nice to return more detailed errors (not found vs could not
+// parse vs merging error).
+rust::Vec<uint8_t> MaybeReadConfigForRust(
+ rust::Str path, rust::Slice<const rust::Str> extra_import_paths);
+
+} // namespace aos::configuration
+
+#endif // AOS_CONFIGURATION_FOR_RUST_H_