pub struct LayoutFinding {
pub path: String,
pub contract: String,
pub excludes: String,
pub reason: String,
}Expand description
One misplaced artifact: a path found in a half whose declared layout excludes it, with the contract that excludes it and why, so a refusal names what to move and where it belongs.
It travels as the JSON of the layout.check capability, so its member names are the
wire contract every projection reads:
use majordomus_cli::layout::LayoutFinding;
let finding = LayoutFinding {
path: ".ai/local/notes/rule.md".into(),
contract: "manifest local".into(),
excludes: "canonical".into(),
reason: "a copy of .ai/repo/rules/rule.md".into(),
};
let json = serde_json::to_value(&finding).unwrap();
assert_eq!(json["contract"], "manifest local");
assert_eq!(json["excludes"], "canonical");
let back: LayoutFinding = serde_json::from_value(json).unwrap();
assert_eq!(back, finding);Fields§
§path: StringThe path, repository-relative.
contract: StringThe contract it violates: a context document’s id, or manifest local.
excludes: StringWhat the contract excludes that this path is.
reason: StringWhat the path was found to be, and how.
Trait Implementations§
Source§impl Clone for LayoutFinding
impl Clone for LayoutFinding
Source§fn clone(&self) -> LayoutFinding
fn clone(&self) -> LayoutFinding
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 LayoutFinding
impl Debug for LayoutFinding
Source§impl<'de> Deserialize<'de> for LayoutFinding
impl<'de> Deserialize<'de> for LayoutFinding
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 LayoutFinding
Source§impl JsonSchema for LayoutFinding
impl JsonSchema for LayoutFinding
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 Ordered for LayoutFinding
Findings are listed by path, the contract breaking the tie, as everywhere else.
impl Ordered for LayoutFinding
Findings are listed by path, the contract breaking the tie, as everywhere else.
Source§impl PartialEq for LayoutFinding
impl PartialEq for LayoutFinding
Source§fn eq(&self, other: &LayoutFinding) -> bool
fn eq(&self, other: &LayoutFinding) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for LayoutFinding
impl Serialize for LayoutFinding
impl StructuralPartialEq for LayoutFinding
Auto Trait Implementations§
impl Freeze for LayoutFinding
impl RefUnwindSafe for LayoutFinding
impl Send for LayoutFinding
impl Sync for LayoutFinding
impl Unpin for LayoutFinding
impl UnsafeUnpin for LayoutFinding
impl UnwindSafe for LayoutFinding
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.