v0.1.4-pre.002
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
// file: crates/ksp-config-lib/src/registry.rs
|
||||
// version: 3
|
||||
// version: 4
|
||||
|
||||
/// Bootstrap argument used to replace a known Config filename mapping.
|
||||
pub const ARG_FILE_MAP: &str = "--filemap";
|
||||
@@ -165,6 +165,13 @@ impl ConfigFileRegistry {
|
||||
return std::result::Result::Ok(registry);
|
||||
}
|
||||
|
||||
/// Iterates over all registered descriptors in deterministic logical `file_id` order.
|
||||
///
|
||||
/// The returned view is read-only and reflects filename overrides already applied to this registry.
|
||||
pub fn descriptors(&self) -> impl std::iter::Iterator<Item = &ConfigFileDescriptor> + '_ {
|
||||
return self.descriptors.values();
|
||||
}
|
||||
|
||||
/// Returns the descriptor associated with a known logical file identifier.
|
||||
pub fn descriptor(&self, file_id: &ConfigFileId) -> ksp_core_lib::Result<&ConfigFileDescriptor> {
|
||||
return match self.descriptors.get(file_id) {
|
||||
|
||||
Reference in New Issue
Block a user