pub struct JsonPatchOperation {
pub op: String,
pub path: String,
pub value: Option<Value>,
pub from: Option<String>,
}Expand description
A JSON Patch operation (RFC 6902) for creating or updating work items.
Use the convenience constructors:
JsonPatchOperation::add()— Set a field valueJsonPatchOperation::remove()— Remove a fieldJsonPatchOperation::replace()— Change a field valueJsonPatchOperation::test()— Assert a field value
§Example
use azure_devops::work_items::models::JsonPatchOperation;
let patch = vec![
JsonPatchOperation::add("/fields/System.Title", "Fix login bug"),
JsonPatchOperation::add("/fields/System.Tags", "security;login"),
];Fields§
§op: StringThe operation: "add", "remove", "replace", "test", etc.
path: StringThe JSON Pointer path to the field (e.g., "/fields/System.Title").
value: Option<Value>The value to set (for add, replace, test operations).
from: Option<String>The source path for copy or move operations.
Implementations§
Trait Implementations§
Source§impl Clone for JsonPatchOperation
impl Clone for JsonPatchOperation
Source§impl Debug for JsonPatchOperation
impl Debug for JsonPatchOperation
Source§impl<'de> Deserialize<'de> for JsonPatchOperation
impl<'de> Deserialize<'de> for JsonPatchOperation
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
Auto Trait Implementations§
impl Freeze for JsonPatchOperation
impl RefUnwindSafe for JsonPatchOperation
impl Send for JsonPatchOperation
impl Sync for JsonPatchOperation
impl Unpin for JsonPatchOperation
impl UnsafeUnpin for JsonPatchOperation
impl UnwindSafe for JsonPatchOperation
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