SarifValidator

Struct SarifValidator 

Source
pub struct SarifValidator {
    pub level: ValidationLevel,
    pub deep_validation: bool,
    pub validate_references: bool,
    pub validate_uris: bool,
    pub validate_schema: bool,
    pub allow_unknown_properties: bool,
    pub max_depth: Option<usize>,
}
Expand description

Comprehensive SARIF validator

Fields§

§level: ValidationLevel

Validation strictness level

§deep_validation: bool

Whether to perform deep validation

§validate_references: bool

Whether to validate cross-references

§validate_uris: bool

Whether to validate URIs

§validate_schema: bool

Whether to validate against JSON schema

§allow_unknown_properties: bool

Whether to allow unknown properties

§max_depth: Option<usize>

Maximum allowed nesting depth

Implementations§

Source§

impl SarifValidator

Source

pub fn new() -> Self

Create a new validator with default settings

Source

pub fn minimal() -> Self

Create a minimal validator (fastest)

Source

pub fn strict() -> Self

Create a strict validator (most thorough)

Source

pub fn pedantic() -> Self

Create a pedantic validator (specification compliance)

Source

pub fn with_level(self, level: ValidationLevel) -> Self

Set validation level

Source

pub fn with_deep_validation(self, deep: bool) -> Self

Set whether to perform deep validation

Source

pub fn with_reference_validation(self, validate: bool) -> Self

Set whether to validate cross-references

Source

pub fn with_uri_validation(self, validate: bool) -> Self

Set whether to validate URIs

Source

pub fn with_schema_validation(self, validate: bool) -> Self

Set whether to validate against JSON schema

Source

pub fn with_max_depth(self, depth: Option<usize>) -> Self

Set maximum nesting depth

Source

pub fn validate_sarif_log(&self, sarif: &SarifLog) -> ValidationResult<()>

Validate a SARIF log

Source

pub fn validate_run(&self, run: &Run) -> ValidationResult<()>

Validate a run object

Source

pub fn validate_tool(&self, tool: &Tool) -> ValidationResult<()>

Validate a tool object

Source

pub fn validate_tool_component( &self, component: &ToolComponent, ) -> ValidationResult<()>

Validate a tool component

Source

pub fn validate_result(&self, result: &Result) -> ValidationResult<()>

Validate a result object

Source

pub fn validate_message(&self, message: &Message) -> ValidationResult<()>

Validate a message object

Source

pub fn validate_location(&self, location: &Location) -> ValidationResult<()>

Validate a location object

Source

pub fn validate_physical_location( &self, location: &PhysicalLocation, ) -> ValidationResult<()>

Validate a physical location

Source

pub fn validate_artifact_location( &self, location: &ArtifactLocation, ) -> ValidationResult<()>

Validate an artifact location

Source

pub fn validate_region(&self, region: &Region) -> ValidationResult<()>

Validate a region with enhanced SARIF-specific constraints

Source

pub fn validate_logical_location( &self, _location: &LogicalLocation, ) -> ValidationResult<()>

Validate a logical location

Source

pub fn validate_artifact(&self, artifact: &Artifact) -> ValidationResult<()>

Validate an artifact

Source

pub fn validate_invocation( &self, _invocation: &Invocation, ) -> ValidationResult<()>

Validate an invocation

Source

pub fn validate_reporting_descriptor( &self, descriptor: &ReportingDescriptor, ) -> ValidationResult<()>

Validate a reporting descriptor

Source

pub fn validate_code_flow(&self, code_flow: &CodeFlow) -> ValidationResult<()>

Validate a code flow

Source

pub fn validate_thread_flow( &self, thread_flow: &ThreadFlow, ) -> ValidationResult<()>

Validate a thread flow

Source

pub fn validate_thread_flow_location( &self, _location: &ThreadFlowLocation, ) -> ValidationResult<()>

Validate a thread flow location

Source

pub fn validate_fix(&self, fix: &Fix) -> ValidationResult<()>

Validate a fix

Source

pub fn validate_artifact_change( &self, change: &ArtifactChange, ) -> ValidationResult<()>

Validate an artifact change

Source

pub fn validate_replacement( &self, replacement: &Replacement, ) -> ValidationResult<()>

Validate a replacement

Source

pub fn validate_version(&self, version: &str) -> ValidationResult<()>

Validate a SARIF version string

Source

pub fn validate_version_with_compatibility( &self, version: &str, strict_compatibility: bool, ) -> ValidationResult<()>

Validate version with compatibility options

Source

pub fn validate_uri(&self, uri: &str) -> ValidationResult<()>

Validate a URI string with enhanced checks

Source

pub fn validate_uri_with_context( &self, uri: &str, context: &ValidationContext, ) -> ValidationResult<()>

Validate URI with context (base URIs)

Source

pub fn validate_run_references(&self, run: &Run) -> ValidationResult<()>

Validate cross-references within a run with enhanced checks

Trait Implementations§

Source§

impl Debug for SarifValidator

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for SarifValidator

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> ErasedDestructor for T
where T: 'static,