pub struct BindingDrift {
pub plan_changed: bool,
pub evidence_changed: bool,
}Expand description
How a binding moved between two reads: what a resumed worker is told.
use majordomus_cli::intent_binding::BindingDrift;
let d = BindingDrift::between("a", "s1", "a", "s2");
assert!(!d.plan_changed && d.evidence_changed);
assert_eq!(d.as_str(), "evidence_moved");
assert_eq!(BindingDrift::between("a", "s", "a", "s").as_str(), "unchanged");
assert_eq!(BindingDrift::between("a", "s", "b", "s").as_str(), "plan_changed");Fields§
§plan_changed: boolThe intent, a link or the critique was edited since the pin was taken.
evidence_changed: boolA served criterion’s evidence changed state since the pin was taken.
Implementations§
Source§impl BindingDrift
impl BindingDrift
Sourcepub fn between(
pinned_plan: &str,
pinned_evidence: &str,
plan: &str,
evidence: &str,
) -> Self
pub fn between( pinned_plan: &str, pinned_evidence: &str, plan: &str, evidence: &str, ) -> Self
Compare the pins a record carries with the pins the binding answers now.
use majordomus_cli::intent_binding::BindingDrift;
assert!(BindingDrift::between("a", "s", "b", "t").plan_changed);Sourcepub fn as_str(self) -> &'static str
pub fn as_str(self) -> &'static str
One word: unchanged, evidence_moved, or plan_changed (which outranks the other,
because a worker whose criteria were rewritten must re-read them before anything).
use majordomus_cli::intent_binding::BindingDrift;
assert_eq!(BindingDrift::between("a", "s", "b", "t").as_str(), "plan_changed");Trait Implementations§
Source§impl Clone for BindingDrift
impl Clone for BindingDrift
Source§fn clone(&self) -> BindingDrift
fn clone(&self) -> BindingDrift
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 moreimpl Copy for BindingDrift
Source§impl Debug for BindingDrift
impl Debug for BindingDrift
Source§impl<'de> Deserialize<'de> for BindingDrift
impl<'de> Deserialize<'de> for BindingDrift
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 BindingDrift
Source§impl JsonSchema for BindingDrift
impl JsonSchema for BindingDrift
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 moreSource§impl PartialEq for BindingDrift
impl PartialEq for BindingDrift
Source§fn eq(&self, other: &BindingDrift) -> bool
fn eq(&self, other: &BindingDrift) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for BindingDrift
impl Serialize for BindingDrift
impl StructuralPartialEq for BindingDrift
Auto Trait Implementations§
impl Freeze for BindingDrift
impl RefUnwindSafe for BindingDrift
impl Send for BindingDrift
impl Sync for BindingDrift
impl Unpin for BindingDrift
impl UnsafeUnpin for BindingDrift
impl UnwindSafe for BindingDrift
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.