pub struct PatchFlags {
pub status: Option<String>,
pub priority: Option<String>,
pub assignee: Option<String>,
pub labels: Option<String>,
pub start_date: Option<String>,
pub due_date: Option<String>,
pub estimate: Option<String>,
pub cycles: Option<String>,
pub milestones: Option<String>,
pub clear: Vec<String>,
}Expand description
The patch flags, exactly the confirmed typed fields.
A closed list, in the same sense IssuePatch is: there is no --set key=value, so
there is no route by which --set number=99 or --set body=… reaches the code.
contracts/cli-surface.md: “Patch flags are limited to the confirmed typed fields.”
Fields§
§status: Option<String>§priority: Option<String>§assignee: Option<String>§labels: Option<String>§start_date: Option<String>§due_date: Option<String>§estimate: Option<String>§cycles: Option<String>§milestones: Option<String>§clear: Vec<String>--clear <field>, for the fields that support clearing.
Implementations§
Source§impl PatchFlags
impl PatchFlags
Sourcepub fn field_rows() -> &'static [&'static str]
pub fn field_rows() -> &'static [&'static str]
The flag rows, in the contract’s field order, plus clear.
The one list, so the TUI’s tab order, the CLI’s help and a test’s
“every field is reachable” case cannot disagree. clear is last because it is
the one row that is not a set — it empties a field, and a user tabbing
through expects to set values first and clear one afterwards.
Sourcepub fn is_clearable(field: &str) -> bool
pub fn is_clearable(field: &str) -> bool
Whether a field name can be cleared.
Sourcepub fn to_patch(&self) -> Result<IssuePatch>
pub fn to_patch(&self) -> Result<IssuePatch>
Build the typed patch.
A blank flag value is Unchanged, not Clear and not Set(""). A flag
with no value is a flag the user did not mean, and treating it as “set it to
the empty string” is the class of bug PatchValue exists to prevent — reached
through the CLI this time rather than through the type.
Trait Implementations§
Source§impl Clone for PatchFlags
impl Clone for PatchFlags
Source§impl Debug for PatchFlags
impl Debug for PatchFlags
Source§impl Default for PatchFlags
impl Default for PatchFlags
impl Eq for PatchFlags
Source§impl PartialEq for PatchFlags
impl PartialEq for PatchFlags
impl StructuralPartialEq for PatchFlags
Auto Trait Implementations§
impl Freeze for PatchFlags
impl RefUnwindSafe for PatchFlags
impl Send for PatchFlags
impl Sync for PatchFlags
impl Unpin for PatchFlags
impl UnsafeUnpin for PatchFlags
impl UnwindSafe for PatchFlags
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,
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