pub struct ContextItem {
pub kind: ContextItemKind,
pub path: String,
pub preview: Option<String>,
pub blob: Option<ObjectHash>,
}Expand description
A single input item within a ContextSnapshot.
Represents one piece of context the agent has access to — a source
file, a URL, a text snippet, command output, or an image. See
module documentation for the three-layer design (path / blob /
preview) and blob retention strategies.
Fields§
§kind: ContextItemKindThe kind of content this item represents. Determines how
path and blob should be interpreted.
path: StringHuman-readable locator for this item.
Meaning depends on kind: repo-relative path for File,
full URL for Url, descriptive label for Snippet, shell
command for Command, file name for Image.
preview: Option<String>Truncated preview of the content for quick display.
Should be kept under 500 characters. None when no preview
is available (e.g. binary content, very short items where
the full content fits in path).
blob: Option<ObjectHash>Git blob hash referencing the full content at capture time.
For File items, this is the same blob already in the git
tree (zero extra storage due to content-addressing). For
other kinds (Url, Snippet, Command, Image), the content is
stored as a new blob — see module-level docs for retention
strategies. None during the draft/collection phase; should
be set before the snapshot is finalized.
Implementations§
Source§impl ContextItem
impl ContextItem
Trait Implementations§
Source§impl Clone for ContextItem
impl Clone for ContextItem
Source§fn clone(&self) -> ContextItem
fn clone(&self) -> ContextItem
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ContextItem
impl Debug for ContextItem
Source§impl<'de> Deserialize<'de> for ContextItem
impl<'de> Deserialize<'de> for ContextItem
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>,
Auto Trait Implementations§
impl Freeze for ContextItem
impl RefUnwindSafe for ContextItem
impl Send for ContextItem
impl Sync for ContextItem
impl Unpin for ContextItem
impl UnsafeUnpin for ContextItem
impl UnwindSafe for ContextItem
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<T> FileLoadStore for Twhere
T: Serialize + for<'a> Deserialize<'a>,
impl<T> FileLoadStore for Twhere
T: Serialize + for<'a> Deserialize<'a>,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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