#[non_exhaustive]pub struct Diff {
pub path: PathBuf,
pub old_text: Option<String>,
pub new_text: String,
pub meta: Option<Map<String, Value>>,
}Expand description
A diff representing file modifications.
Shows changes to files in a format suitable for display in the client UI.
See protocol docs: Content
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.path: PathBufThe file path being modified.
old_text: Option<String>The original content (None for new files).
new_text: StringThe new content after modification.
meta: Option<Map<String, Value>>The _meta property is reserved by ACP to allow clients and agents to attach additional metadata to their interactions. Implementations MUST NOT make assumptions about values at these keys.
See protocol docs: Extensibility
Implementations§
Source§impl Diff
impl Diff
Sourcepub fn new(path: impl Into<PathBuf>, new_text: impl Into<String>) -> Diff
pub fn new(path: impl Into<PathBuf>, new_text: impl Into<String>) -> Diff
Builds Diff with the required fields set; optional fields start unset or empty.
Sourcepub fn old_text(self, old_text: impl IntoOption<String>) -> Diff
pub fn old_text(self, old_text: impl IntoOption<String>) -> Diff
The original content (None for new files).
Sourcepub fn meta(self, meta: impl IntoOption<Map<String, Value>>) -> Diff
pub fn meta(self, meta: impl IntoOption<Map<String, Value>>) -> Diff
The _meta property is reserved by ACP to allow clients and agents to attach additional metadata to their interactions. Implementations MUST NOT make assumptions about values at these keys.
See protocol docs: Extensibility
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Diff
impl<'de> Deserialize<'de> for Diff
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<Diff, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<Diff, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
impl Eq for Diff
Source§impl From<Diff> for ToolCallContent
impl From<Diff> for ToolCallContent
Source§fn from(diff: Diff) -> ToolCallContent
fn from(diff: Diff) -> ToolCallContent
Source§impl JsonSchema for Diff
impl JsonSchema for Diff
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read moreSource§impl Serialize for Diff
impl Serialize for Diff
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
impl StructuralPartialEq for Diff
Auto Trait Implementations§
impl Freeze for Diff
impl RefUnwindSafe for Diff
impl Send for Diff
impl Sync for Diff
impl Unpin for Diff
impl UnsafeUnpin for Diff
impl UnwindSafe for Diff
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§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.