pub struct BindingRefusal {
pub issue: Option<String>,
pub cause: BindingCause,
pub message: String,
}Expand description
One reason a binding was refused.
use majordomus_cli::intent_binding::{BindingCause, BindingRefusal};
let r = BindingRefusal::new(None, BindingCause::NothingNamed, "name the work".into());
assert!(r.issue.is_none());
assert_eq!(r.cause, BindingCause::NothingNamed);Fields§
§issue: Option<String>The issue it is about; absent when it is about no one issue.
cause: BindingCauseThe cause.
message: StringWhat is wrong, in one sentence.
Implementations§
Source§impl BindingRefusal
impl BindingRefusal
Sourcepub fn new(issue: Option<&str>, cause: BindingCause, message: String) -> Self
pub fn new(issue: Option<&str>, cause: BindingCause, message: String) -> Self
A refusal about issue, or about no one issue.
use majordomus_cli::intent_binding::{BindingCause, BindingRefusal};
let r = BindingRefusal::new(Some("I0001"), BindingCause::UnknownIssue, "x".into());
assert_eq!(r.issue.as_deref(), Some("I0001"));Trait Implementations§
Source§impl Clone for BindingRefusal
impl Clone for BindingRefusal
Source§fn clone(&self) -> BindingRefusal
fn clone(&self) -> BindingRefusal
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 BindingRefusal
impl Debug for BindingRefusal
Source§impl<'de> Deserialize<'de> for BindingRefusal
impl<'de> Deserialize<'de> for BindingRefusal
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 BindingRefusal
Source§impl JsonSchema for BindingRefusal
impl JsonSchema for BindingRefusal
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 BindingRefusal
impl PartialEq for BindingRefusal
Source§fn eq(&self, other: &BindingRefusal) -> bool
fn eq(&self, other: &BindingRefusal) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for BindingRefusal
impl Serialize for BindingRefusal
impl StructuralPartialEq for BindingRefusal
Auto Trait Implementations§
impl Freeze for BindingRefusal
impl RefUnwindSafe for BindingRefusal
impl Send for BindingRefusal
impl Sync for BindingRefusal
impl Unpin for BindingRefusal
impl UnsafeUnpin for BindingRefusal
impl UnwindSafe for BindingRefusal
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.