pub struct ReviewAnswer {
pub session: String,
pub verdict: String,
pub note: Option<String>,
}Expand description
One answer to a review request: who answered, what they decided, and why. The verdict is one of the three declared words, so a requester can act on it without reading the note; the note is where the reasoning goes and is optional, because “approved” often needs none.
use majordomus_cli::mesh::state::ReviewAnswer;
let answer = ReviewAnswer {
session: "a1b2c3d4-r1-0f/s2".into(),
verdict: "changes_requested".into(),
note: Some("the fold is not deterministic".into()),
};
assert_eq!(answer.verdict, "changes_requested");
// the note is omitted rather than carried empty when there is nothing to say
let bare = ReviewAnswer { note: None, ..answer };
let value = serde_json::to_value(&bare).unwrap();
assert!(value.get("note").is_none());Fields§
§session: StringThe answering session’s key.
verdict: StringThe verdict.
note: Option<String>The note.
Trait Implementations§
Source§impl Clone for ReviewAnswer
impl Clone for ReviewAnswer
Source§fn clone(&self) -> ReviewAnswer
fn clone(&self) -> ReviewAnswer
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 ReviewAnswer
impl Debug for ReviewAnswer
Source§impl<'de> Deserialize<'de> for ReviewAnswer
impl<'de> Deserialize<'de> for ReviewAnswer
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 ReviewAnswer
Source§impl JsonSchema for ReviewAnswer
impl JsonSchema for ReviewAnswer
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 ReviewAnswer
impl PartialEq for ReviewAnswer
Source§fn eq(&self, other: &ReviewAnswer) -> bool
fn eq(&self, other: &ReviewAnswer) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for ReviewAnswer
impl Serialize for ReviewAnswer
impl StructuralPartialEq for ReviewAnswer
Auto Trait Implementations§
impl Freeze for ReviewAnswer
impl RefUnwindSafe for ReviewAnswer
impl Send for ReviewAnswer
impl Sync for ReviewAnswer
impl Unpin for ReviewAnswer
impl UnsafeUnpin for ReviewAnswer
impl UnwindSafe for ReviewAnswer
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.