pub struct QualityGates {
pub min_grade: Grade,
pub min_score: f64,
pub performance: PerformanceGates,
pub accessibility: AccessibilityGates,
pub data: DataGates,
pub documentation: DocumentationGates,
}Expand description
Quality gate configuration (from .presentar-gates.toml).
Fields§
§min_grade: GradeMinimum required grade
min_score: f64Minimum required score (0-100)
performance: PerformanceGatesPerformance requirements
accessibility: AccessibilityGatesAccessibility requirements
data: DataGatesData requirements
documentation: DocumentationGatesDocumentation requirements
Implementations§
Source§impl QualityGates
impl QualityGates
Sourcepub fn check(&self, score: &AppQualityScore) -> GateCheckResult
pub fn check(&self, score: &AppQualityScore) -> GateCheckResult
Check if a quality score passes all gates.
Source§impl QualityGates
impl QualityGates
Sourcepub const CONFIG_FILE: &'static str = ".presentar-gates.toml"
pub const CONFIG_FILE: &'static str = ".presentar-gates.toml"
Default config file name.
Sourcepub fn from_toml(toml_str: &str) -> Result<Self, GateConfigError>
pub fn from_toml(toml_str: &str) -> Result<Self, GateConfigError>
Parse quality gates from a TOML string.
§Errors
Returns error if TOML is invalid or values are out of range.
Sourcepub fn load_from_file(path: &Path) -> Result<Self, GateConfigError>
pub fn load_from_file(path: &Path) -> Result<Self, GateConfigError>
Sourcepub fn save_to_file(&self, path: &Path) -> Result<(), GateConfigError>
pub fn save_to_file(&self, path: &Path) -> Result<(), GateConfigError>
Sourcepub fn load_default() -> Self
pub fn load_default() -> Self
Load from default config file in current directory.
Returns default config if file doesn’t exist.
Sourcepub fn check_extended(
&self,
score: &AppQualityScore,
render_time_ms: Option<u32>,
bundle_size_kb: Option<u32>,
memory_mb: Option<u32>,
) -> GateCheckResult
pub fn check_extended( &self, score: &AppQualityScore, render_time_ms: Option<u32>, bundle_size_kb: Option<u32>, memory_mb: Option<u32>, ) -> GateCheckResult
Check a score with extended validation (performance, bundle size, etc.).
Sourcepub fn sample_config() -> String
pub fn sample_config() -> String
Generate a sample TOML config file content.
Trait Implementations§
Source§impl Clone for QualityGates
impl Clone for QualityGates
Source§fn clone(&self) -> QualityGates
fn clone(&self) -> QualityGates
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for QualityGates
impl Debug for QualityGates
Source§impl Default for QualityGates
impl Default for QualityGates
Source§impl<'de> Deserialize<'de> for QualityGates
impl<'de> Deserialize<'de> for QualityGates
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for QualityGates
impl PartialEq for QualityGates
Source§impl Serialize for QualityGates
impl Serialize for QualityGates
impl StructuralPartialEq for QualityGates
Auto Trait Implementations§
impl Freeze for QualityGates
impl RefUnwindSafe for QualityGates
impl Send for QualityGates
impl Sync for QualityGates
impl Unpin for QualityGates
impl UnwindSafe for QualityGates
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
Converts
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>
Converts
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
Read this value from the supplied reader. Same as
ReadEndian::read_from_little_endian().