pub struct IssuePatch {
pub status: PatchValue<String>,
pub priority: PatchValue<Priority>,
pub assignee: PatchValue<String>,
pub labels: PatchValue<Vec<String>>,
pub start_date: PatchValue<String>,
pub due_date: PatchValue<String>,
pub estimate: PatchValue<String>,
pub cycles: PatchValue<Vec<String>>,
pub milestones: PatchValue<Vec<String>>,
pub relationship: Option<RelationshipOp>,
pub archive: Option<ArchiveRequest>,
}Expand description
The complete set of bulk field operations.
Closed by construction: adding a field means adding it here, and the
patch_fields iterator is what the plan and the CLI both read, so neither can
name a field the other does not know.
Fields§
§status: PatchValue<String>The new column. Validated through the workflow service at apply time, like every other status write.
priority: PatchValue<Priority>§assignee: PatchValue<String>§labels: PatchValue<Vec<String>>§start_date: PatchValue<String>§due_date: PatchValue<String>§estimate: PatchValue<String>§cycles: PatchValue<Vec<String>>§milestones: PatchValue<Vec<String>>§relationship: Option<RelationshipOp>The relationship operation, if this patch names one. A patch is field-change or pair, not both: combining them would make the plan’s “one proposed change per item” ambiguous.
archive: Option<ArchiveRequest>The archive delegation, if this patch names one. Same one-of rule.
Implementations§
Source§impl IssuePatch
impl IssuePatch
Sourcepub fn is_empty(&self) -> bool
pub fn is_empty(&self) -> bool
Whether this patch asks for nothing at all.
Reads every field, not just the string-shaped ones. The first version
consulted Self::fields, which yields only the PatchValue<String>
projection — so a patch that set only priority reported itself empty, and
require_wellformed refused it with “no fields to change” while the user
had named one. Caught by
tests/bulk_selection.rs::t003_a_patch_is_a_whitelist_with_no_escape_hatch,
which is the case this function’s own doc comment describes.
Sourcepub fn all_field_values(&self) -> [(&'static str, bool); 9]
pub fn all_field_values(&self) -> [(&'static str, bool); 9]
Every field value, whether or not it is a String.
The single source of “is this field set”, so is_empty and the
plan’s per-field walk cannot disagree about which fields exist. The
string-shaped Self::fields view is a convenience for rendering; it is
not the definition of which fields a patch carries.
Sourcepub fn changed_fields(&self) -> impl Iterator<Item = (&'static str, bool)>
pub fn changed_fields(&self) -> impl Iterator<Item = (&'static str, bool)>
The field values that would change something, as (name, changed).
Sourcepub fn has_any_field(&self) -> bool
pub fn has_any_field(&self) -> bool
Whether any field is set, ignoring the pair and archive variants. The
question structural_problems needs when it is deciding whether a patch
mixes two kinds of operation.
Sourcepub fn fields(
&self,
) -> impl Iterator<Item = (&'static str, &PatchValue<String>)>
pub fn fields( &self, ) -> impl Iterator<Item = (&'static str, &PatchValue<String>)>
The patch’s own field values, in the contract’s order.
The single enumeration the plan, the CLI renderer and the tests all read. A second list would be a place for the three to disagree about which fields exist — and the WP04 MCP parity bug in the previous mission was exactly a duplicated list drifting from the original.
Sourcepub fn field_names() -> &'static [&'static str]
pub fn field_names() -> &'static [&'static str]
Every field name the patch can carry, in the contract’s order. Used by the CLI’s help and by the “you named no fields” diagnostic.
Sourcepub fn structural_problems(&self) -> Vec<PatchProblem>
pub fn structural_problems(&self) -> Vec<PatchProblem>
Structural problems that are not field-value validation.
Field values are validated by the same cores as single-issue operations (contract §5) — at plan time, per item, with the item’s context added. What is checked here is only what can be known without an issue: that the patch is not empty, and that it is not two kinds of operation at once.
A patch is one of field change, relationship pair, or archive delegation. Combining them is refused rather than resolved, because “what is the order” has no answer that is right for every pair of operations, and an order invented here would be a policy nobody chose.
Sourcepub fn require_wellformed(&self) -> Result<()>
pub fn require_wellformed(&self) -> Result<()>
Refuse the patch if it has structural problems, with the first message.
Trait Implementations§
Source§impl Clone for IssuePatch
impl Clone for IssuePatch
Source§impl Debug for IssuePatch
impl Debug for IssuePatch
Source§impl Default for IssuePatch
impl Default for IssuePatch
Source§impl<'de> Deserialize<'de> for IssuePatch
impl<'de> Deserialize<'de> for IssuePatch
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 IssuePatch
Source§impl PartialEq for IssuePatch
impl PartialEq for IssuePatch
Source§impl Serialize for IssuePatch
impl Serialize for IssuePatch
impl StructuralPartialEq for IssuePatch
Auto Trait Implementations§
impl Freeze for IssuePatch
impl RefUnwindSafe for IssuePatch
impl Send for IssuePatch
impl Sync for IssuePatch
impl Unpin for IssuePatch
impl UnsafeUnpin for IssuePatch
impl UnwindSafe for IssuePatch
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
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>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more