configbuilder_pattern_builder/builder_finalizer.rs
1/// Consume a configured builder and produce a ready-to-use section loader.
2///
3/// Implemented by the real builder types in `configbuilder-svc-saf`
4/// so construction logic can access real filesystem/XDG internals.
5pub trait BuilderFinalizer {
6 /// The concrete loader type produced by this builder.
7 type Loader;
8
9 /// The error type returned on build failure.
10 type Error: std::error::Error;
11
12 /// Consume the builder and return a ready-to-use section loader.
13 ///
14 /// # Errors
15 ///
16 /// Returns an error if the resolved config directory path contains `..`
17 /// traversal components, or if a resolved path exists but is not a directory.
18 fn build_loader(self) -> Result<Self::Loader, Self::Error>;
19}