#[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
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
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
pub fn new(path: impl Into<PathBuf>, new_text: impl Into<String>) -> Diff
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>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl From<Diff> for ToolCallContent
impl From<Diff> for ToolCallContent
Source§fn from(diff: Diff) -> ToolCallContent
fn from(diff: Diff) -> ToolCallContent
Converts to this type from the input type.
Source§impl JsonSchema for Diff
impl JsonSchema for Diff
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Returns a string that uniquely identifies the schema produced by this type. Read more
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
Whether JSON Schemas generated for this type should be included directly in parent schemas,
rather than being re-used where possible using the
$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,
Serialize this value into the given Serde serializer. Read more
impl Eq for Diff
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 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
Mutably borrows from an owned value. Read more