pub struct Obligation {
pub id: String,
pub title: String,
pub summary: String,
pub discharged_by: String,
pub inputs: Vec<String>,
pub remote: bool,
pub note: String,
}Expand description
One token a task may declare in requires, as the distribution ships it.
remote and inputs are what decide how its evidence is judged, and they are the
file’s decision rather than this reader’s: a fact the working tree cannot establish is
bound to the commit it was taken at, and everything else is bound to the bytes of the
files its pathspecs select.
use majordomus_cli::capability::builtin::obligations::Obligation;
let push: Obligation = serde_json::from_str(
r#"{"id":"push","title":"The commit reached the remote",
"summary":"The branch's head exists on the remote it tracks.",
"discharged_by":"git","remote":true}"#,
)
.unwrap();
assert!(push.remote);
assert!(push.inputs.is_empty(), "a remote fact is bound to a commit, not to a tree");Fields§
§id: StringThe token, as a task’s requires names it.
title: StringThe obligation as a heading.
summary: StringWhat a worker is being asked to have done.
discharged_by: StringThe command that produces the evidence. none for a token held by another line of
the contract and listed so that a report can say it rather than leave a hole.
inputs: Vec<String>The pathspecs the evidence is hashed over. Empty for a token whose fact is remote,
and empty for one bound to neither: see ObligationClosure::staleness.
remote: boolTrue when the fact cannot be established from the working tree alone — a push, a publication, a deployment. Such evidence is bound to a commit, not to a tree.
note: StringWhat the vocabulary says about the token beyond its summary.
Trait Implementations§
Source§impl Clone for Obligation
impl Clone for Obligation
Source§fn clone(&self) -> Obligation
fn clone(&self) -> Obligation
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 Obligation
impl Debug for Obligation
Source§impl<'de> Deserialize<'de> for Obligation
impl<'de> Deserialize<'de> for Obligation
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 Obligation
Source§impl JsonSchema for Obligation
impl JsonSchema for Obligation
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 Obligation
impl PartialEq for Obligation
Source§fn eq(&self, other: &Obligation) -> bool
fn eq(&self, other: &Obligation) -> bool
self and other values to be equal, and is used by ==.Source§impl Serialize for Obligation
impl Serialize for Obligation
impl StructuralPartialEq for Obligation
Auto Trait Implementations§
impl Freeze for Obligation
impl RefUnwindSafe for Obligation
impl Send for Obligation
impl Sync for Obligation
impl Unpin for Obligation
impl UnsafeUnpin for Obligation
impl UnwindSafe for Obligation
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.