pub struct Chunk {Show 13 fields
pub id: String,
pub file: PathBuf,
pub language: Language,
pub chunk_type: ChunkType,
pub name: String,
pub signature: String,
pub content: String,
pub doc: Option<String>,
pub line_start: u32,
pub line_end: u32,
pub content_hash: String,
pub parent_id: Option<String>,
pub window_idx: Option<u32>,
}Expand description
A parsed code chunk (function, method, class, etc.)
Chunks are the basic unit of indexing and search in cqs. Each chunk represents a single code element extracted by tree-sitter.
Fields§
§id: StringUnique identifier: {file}:{line_start}:{content_hash} or {parent_id}:w{window_idx}
file: PathBufSource file path (typically absolute during indexing, stored as provided)
language: LanguageProgramming language
chunk_type: ChunkTypeType of code element
name: StringName of the function/class/etc.
signature: StringFunction signature or declaration line
content: StringFull source code content (may be windowed portion of original)
doc: Option<String>Documentation comment if present
line_start: u32Starting line number (1-indexed)
line_end: u32Ending line number (1-indexed)
content_hash: StringBLAKE3 hash of content for change detection
parent_id: Option<String>Parent chunk ID if this is a windowed portion of a larger chunk
window_idx: Option<u32>Window index (0, 1, 2…) if this is a windowed portion
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Chunk
impl RefUnwindSafe for Chunk
impl Send for Chunk
impl Sync for Chunk
impl Unpin for Chunk
impl UnwindSafe for Chunk
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> 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