pub enum DiffContentReference {
Inline(String),
ReadFromFile {
path: PathBuf,
start_commit: String,
description: String,
},
}Expand description
Specialized reference for DIFF content.
When DIFF is too large, instructs the agent to use git diff command
instead of embedding the diff content.
Variants§
Inline(String)
DIFF is small enough to embed inline.
ReadFromFile
DIFF is too large; agent should read from a file (with git diff fallback).
Implementations§
Source§impl DiffContentReference
impl DiffContentReference
Sourcepub fn from_diff(
diff_content: String,
start_commit: &str,
diff_path: &Path,
) -> Self
pub fn from_diff( diff_content: String, start_commit: &str, diff_path: &Path, ) -> Self
Create a diff reference, choosing inline vs git command based on size.
If diff_content.len() <= MAX_INLINE_CONTENT_SIZE, the diff is stored inline.
Otherwise, instructions to read from a file are provided (with git diff fallback).
§Arguments
diff_content- The diff contentstart_commit- The commit hash to diff from
Sourcepub fn render_for_template(&self) -> String
pub fn render_for_template(&self) -> String
Get the content for template rendering.
For inline: returns the diff content directly. For git diff: returns instructions to run the git command.
Trait Implementations§
Source§impl Clone for DiffContentReference
impl Clone for DiffContentReference
Source§fn clone(&self) -> DiffContentReference
fn clone(&self) -> DiffContentReference
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for DiffContentReference
impl Debug for DiffContentReference
Source§impl PartialEq for DiffContentReference
impl PartialEq for DiffContentReference
impl Eq for DiffContentReference
impl StructuralPartialEq for DiffContentReference
Auto Trait Implementations§
impl Freeze for DiffContentReference
impl RefUnwindSafe for DiffContentReference
impl Send for DiffContentReference
impl Sync for DiffContentReference
impl Unpin for DiffContentReference
impl UnwindSafe for DiffContentReference
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
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§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
Compare self to
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>
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 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>
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