pub struct Triad {
pub current: Statement,
pub expected: Vec<Statement>,
pub unchanged: Vec<Statement>,
pub digest: String,
}Expand description
The person’s three statements about a bug.
Fields§
§current: StatementWhat happens now (the symptom).
expected: Vec<Statement>What should happen instead; at least one.
unchanged: Vec<Statement>What must keep working as it does.
digest: Stringsha256:<hex> over the normalised statements: a different digest
lapses a confirmation.
Implementations§
Source§impl Triad
impl Triad
Sourcepub fn new(
current: &str,
expected: &[String],
unchanged: &[String],
hash: impl Fn(&[u8]) -> String,
) -> Result<Self, TriadError>
pub fn new( current: &str, expected: &[String], unchanged: &[String], hash: impl Fn(&[u8]) -> String, ) -> Result<Self, TriadError>
The triad of the person’s words; hash gives the hex SHA-256 of
bytes (the core does no hashing itself).
§Errors
An empty symptom or statement, or no Expected statement.
Sourcepub fn canonical(&self) -> String
pub fn canonical(&self) -> String
The text the digest is over: one id<TAB>words line per statement.
Sourcepub fn statements(&self) -> impl Iterator<Item = &Statement>
pub fn statements(&self) -> impl Iterator<Item = &Statement>
Every statement: current, expected, unchanged.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Triad
impl<'de> Deserialize<'de> for Triad
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
impl Eq for Triad
Source§impl JsonSchema for Triad
impl JsonSchema for Triad
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Returns a string that uniquely identifies the schema produced by this type. Read more
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
Whether JSON Schemas generated for this type should be included directly in parent schemas,
rather than being re-used where possible using the
$ref keyword. Read moreimpl StructuralPartialEq for Triad
Auto Trait Implementations§
impl Freeze for Triad
impl RefUnwindSafe for Triad
impl Send for Triad
impl Sync for Triad
impl Unpin for Triad
impl UnsafeUnpin for Triad
impl UnwindSafe for Triad
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