pub struct SteeringLoader;Expand description
Loads and merges steering documents
Implementations§
Source§impl SteeringLoader
impl SteeringLoader
Sourcepub fn load(path: &Path) -> Result<Steering, SpecError>
pub fn load(path: &Path) -> Result<Steering, SpecError>
Load steering from a directory
Searches for YAML and Markdown files in the directory and loads them. Returns a merged Steering document with all rules, standards, and templates.
§Arguments
path- Directory path to search for steering files
§Returns
Ok(Steering)- Merged steering documentErr(SpecError)- If loading or parsing fails
Sourcepub fn merge(
global: &Steering,
project: &Steering,
) -> Result<Steering, SpecError>
pub fn merge( global: &Steering, project: &Steering, ) -> Result<Steering, SpecError>
Merge global and project steering
Project steering takes precedence over global steering. Rules, standards, and templates are merged with project items overriding global items when they have the same ID.
§Arguments
global- Global steering documentproject- Project steering document
§Returns
Ok(Steering)- Merged steering document with project taking precedenceErr(SpecError)- If merge fails
Sourcepub fn validate(steering: &Steering) -> Result<(), SpecError>
pub fn validate(steering: &Steering) -> Result<(), SpecError>
Validate steering syntax and semantics
Checks that:
- All rule IDs are unique
- All standard IDs are unique
- All template IDs are unique
- Rules have non-empty descriptions and patterns
- Standards have non-empty descriptions
- Templates have non-empty paths
§Arguments
steering- Steering document to validate
§Returns
Ok(())- If steering is validErr(SpecError)- If validation fails
Auto Trait Implementations§
impl Freeze for SteeringLoader
impl RefUnwindSafe for SteeringLoader
impl Send for SteeringLoader
impl Sync for SteeringLoader
impl Unpin for SteeringLoader
impl UnwindSafe for SteeringLoader
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more