pub struct IntentBinding {
pub standing: BindingStanding,
pub named: BindingRequest,
pub exemption: Option<BindingExemption>,
pub issues: Vec<IntentPreflightIssue>,
pub intents: Vec<IntentPreflightIntent>,
pub governance: Vec<String>,
pub plan_revision: String,
pub evidence_standing: String,
pub notes: Vec<String>,
pub refusals: Vec<BindingRefusal>,
pub refusal: Option<String>,
}Expand description
What a piece of work is bound to: its standing, what was named, the issues and intents it resolved to with what each intent asks of the worker, the two pins, and every refusal.
use majordomus_cli::intent::Intents;
use majordomus_cli::intent_binding::{
bind, BindingCause, BindingRequest, BindingStanding, IntentBinding,
};
use majordomus_cli::plan::Plan;
use majordomus_cli::policy::IntentPolicy;
let intents = Intents { intents: vec![], findings: vec![] };
let nothing: IntentBinding =
bind(&intents, &plan, &[], &[], &IntentPolicy::default(), BindingRequest::default());
assert_eq!(nothing.standing, BindingStanding::Refused);
assert_eq!(nothing.refusals[0].cause, BindingCause::NothingNamed);
// nothing was reached, so there is nothing to pin
assert!(nothing.plan_revision.is_empty() && nothing.evidence_standing.is_empty());Fields§
§standing: BindingStandingbound, maintenance, exempt or refused.
named: BindingRequestWhat the worker named, trimmed: the request this answers.
exemption: Option<BindingExemption>The exemption accepted, when the standing is exempt.
issues: Vec<IntentPreflightIssue>The issues the work resolved to, each with the preflight’s verdict.
intents: Vec<IntentPreflightIntent>The intents the work serves, each with the criteria served, their evidence state, the invariants, the critique and the gap: what the worker is held to.
governance: Vec<String>The governance of those intents, each entry once.
plan_revision: StringThe pin of what the work is for; empty when no intent was reached.
evidence_standing: StringThe pin of where the served criteria’s evidence stands; empty when no intent was reached.
notes: Vec<String>What a worker should know and no gate refuses on.
refusals: Vec<BindingRefusal>Every reason the binding was refused; empty unless the standing is refused.
refusal: Option<String>When refused: every refusal’s sentence, joined.
Trait Implementations§
Source§impl Clone for IntentBinding
impl Clone for IntentBinding
Source§fn clone(&self) -> IntentBinding
fn clone(&self) -> IntentBinding
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for IntentBinding
impl Debug for IntentBinding
Source§impl<'de> Deserialize<'de> for IntentBinding
impl<'de> Deserialize<'de> for IntentBinding
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>,
impl Eq for IntentBinding
Source§impl JsonSchema for IntentBinding
impl JsonSchema for IntentBinding
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read moreSource§impl PartialEq for IntentBinding
impl PartialEq for IntentBinding
Source§fn eq(&self, other: &IntentBinding) -> bool
fn eq(&self, other: &IntentBinding) -> bool
self and other values to be equal, and is used by ==.Source§impl Serialize for IntentBinding
impl Serialize for IntentBinding
impl StructuralPartialEq for IntentBinding
Auto Trait Implementations§
impl Freeze for IntentBinding
impl RefUnwindSafe for IntentBinding
impl Send for IntentBinding
impl Sync for IntentBinding
impl Unpin for IntentBinding
impl UnsafeUnpin for IntentBinding
impl UnwindSafe for IntentBinding
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
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
key and return true if they are equal.