blob: 9bf9c75c09a45a36122647ee32dcd9d2f097e8f1 [file] [log] [blame]
Brian Silverman7edd1ce2022-07-23 16:10:54 -07001#ifndef AOS_CONFIGURATION_FOR_RUST_H_
2#define AOS_CONFIGURATION_FOR_RUST_H_
3
4#include "aos/configuration.h"
5#include "cxx.h"
6
7namespace aos::configuration {
8
9const Channel *GetChannelForRust(const Configuration *config, rust::Str name,
10 rust::Str type, rust::Str application_name,
11 const Node *node);
12
Brian Silverman67cdbd62022-08-15 06:03:55 -070013const Node *GetNodeForRust(const Configuration *config, rust::Str name);
14
Brian Silverman7edd1ce2022-07-23 16:10:54 -070015// Returns a Configuration flatbuffer. Returns an empty vector on errors.
Brian Silverman67cdbd62022-08-15 06:03:55 -070016// TODO(Brian): It would be nice to return more detailed errors (not found vs
17// could not parse vs merging error).
Brian Silverman7edd1ce2022-07-23 16:10:54 -070018rust::Vec<uint8_t> MaybeReadConfigForRust(
19 rust::Str path, rust::Slice<const rust::Str> extra_import_paths);
20
21} // namespace aos::configuration
22
23#endif // AOS_CONFIGURATION_FOR_RUST_H_