pub struct BisectPredicates {
pub node_count_min: Option<u64>,
pub node_count_max: Option<u64>,
pub nodes_exist: Vec<String>,
pub nodes_missing: Vec<String>,
pub nodes_alive: Vec<String>,
pub rule_violations_max: Option<u64>,
}Expand description
The set of predicates the user wrote in .cgx/bisect.toml.
Empty fields are treated as “no constraint”. All present fields must hold for a commit to be considered “good”.
Fields§
§node_count_min: Option<u64>Graph must have at least this many nodes.
node_count_max: Option<u64>Graph must have at most this many nodes.
nodes_exist: Vec<String>Every node ID in this list must exist.
nodes_missing: Vec<String>No node ID in this list may exist.
nodes_alive: Vec<String>Every node ID in this list must exist AND not be flagged as a dead-code candidate.
rule_violations_max: Option<u64>Total rule violations (per cgx rules check) must be ≤ this number.
Implementations§
Source§impl BisectPredicates
impl BisectPredicates
Sourcepub fn load(repo_path: &Path, custom: Option<&Path>) -> Result<Self>
pub fn load(repo_path: &Path, custom: Option<&Path>) -> Result<Self>
Read predicates from .cgx/bisect.toml (or the supplied custom path).
Sourcepub fn default_path(repo_path: &Path) -> PathBuf
pub fn default_path(repo_path: &Path) -> PathBuf
Path the bisect script writes to by default.
Sourcepub fn evaluate(&self, db: &GraphDb) -> Result<BisectReport>
pub fn evaluate(&self, db: &GraphDb) -> Result<BisectReport>
Evaluate every populated predicate against the live graph.
Trait Implementations§
Source§impl Clone for BisectPredicates
impl Clone for BisectPredicates
Source§fn clone(&self) -> BisectPredicates
fn clone(&self) -> BisectPredicates
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 BisectPredicates
impl Debug for BisectPredicates
Source§impl Default for BisectPredicates
impl Default for BisectPredicates
Source§fn default() -> BisectPredicates
fn default() -> BisectPredicates
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for BisectPredicates
impl<'de> Deserialize<'de> for BisectPredicates
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
Auto Trait Implementations§
impl Freeze for BisectPredicates
impl RefUnwindSafe for BisectPredicates
impl Send for BisectPredicates
impl Sync for BisectPredicates
impl Unpin for BisectPredicates
impl UnsafeUnpin for BisectPredicates
impl UnwindSafe for BisectPredicates
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> 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>
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 more