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, the pipeline prefers writing the full diff to a file so agents can read it without invoking git. Some prompts (e.g., review) may include git-based fallback instructions as a last resort.
Variants§
Inline(String)
DIFF is small enough to embed inline.
ReadFromFile
DIFF is too large; agent should read from a file (with optional git 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 file reference 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.
§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 file reference: returns instructions to read from the provided path, plus optional git fallback commands.
Trait Implementations§
Source§impl Clone for DiffContentReference
impl Clone for DiffContentReference
Source§fn clone(&self) -> DiffContentReference
fn clone(&self) -> DiffContentReference
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
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
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
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