Skip to main content

IssuePatch

Struct IssuePatch 

Source
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

Source

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.

Source

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.

Source

pub fn changed_fields(&self) -> impl Iterator<Item = (&'static str, bool)>

The field values that would change something, as (name, changed).

Source

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.

Source

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.

Source

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.

Source

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.

Source

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

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for IssuePatch

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for IssuePatch

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for IssuePatch

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Eq for IssuePatch

Source§

impl PartialEq for IssuePatch

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Serialize for IssuePatch

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for IssuePatch

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.