pub struct ReportFormatter { /* private fields */ }Expand description
Main report formatter that dispatches to specific formatters
Implementations§
Source§impl ReportFormatter
impl ReportFormatter
Sourcepub fn new(options: ReportOptions) -> GuardianResult<Self>
pub fn new(options: ReportOptions) -> GuardianResult<Self>
Create a new report formatter with options
Architecture Principle: Constructor validates domain invariants
Sourcepub fn with_options(options: ReportOptions) -> Self
pub fn with_options(options: ReportOptions) -> Self
Create a formatter with validated options, panicking on invalid configuration
For use in contexts where configuration errors are programming errors
Sourcepub fn validate_capabilities(&self) -> GuardianResult<()>
pub fn validate_capabilities(&self) -> GuardianResult<()>
Validate formatter configuration and capabilities
Architecture Principle: Domain models should validate their own consistency This method ensures the formatter can fulfill its interface contract
Sourcepub fn validate_format_integrity(
&self,
report: &ValidationReport,
format: OutputFormat,
output: &str,
) -> GuardianResult<()>
pub fn validate_format_integrity( &self, report: &ValidationReport, format: OutputFormat, output: &str, ) -> GuardianResult<()>
Validate that a format operation produces expected structure
Architecture Principle: Anti-corruption layer should validate its transformations
Sourcepub fn format_report(
&self,
report: &ValidationReport,
format: OutputFormat,
) -> GuardianResult<String>
pub fn format_report( &self, report: &ValidationReport, format: OutputFormat, ) -> GuardianResult<String>
Format a validation report in the specified format
Architecture Principle: Domain services orchestrate self-validating behavior This method ensures each transformation maintains domain integrity
Sourcepub fn write_report<W: Write>(
&self,
report: &ValidationReport,
format: OutputFormat,
writer: W,
) -> GuardianResult<()>
pub fn write_report<W: Write>( &self, report: &ValidationReport, format: OutputFormat, writer: W, ) -> GuardianResult<()>
Write a formatted report to a writer
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ReportFormatter
impl RefUnwindSafe for ReportFormatter
impl Send for ReportFormatter
impl Sync for ReportFormatter
impl Unpin for ReportFormatter
impl UnwindSafe for ReportFormatter
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more