pub struct CodeChunk {
pub id: Option<i64>,
pub file_path: String,
pub byte_start: usize,
pub byte_end: usize,
pub content: String,
pub content_hash: String,
pub symbol_name: Option<String>,
pub symbol_kind: Option<String>,
pub created_at: i64,
}Expand description
A code chunk with source text and metadata.
Stores a contiguous span of source code with its byte offsets, enabling efficient retrieval of specific code sections without reading entire files.
Fields§
§id: Option<i64>Unique identifier (auto-incremented)
file_path: StringFile path containing this chunk
byte_start: usizeByte offset where chunk starts in source file
byte_end: usizeByte offset where chunk ends in source file
content: StringSource code content for this span
content_hash: StringSHA-256 hash of the content (for deduplication)
symbol_name: Option<String>Optional: symbol name this chunk represents
symbol_kind: Option<String>Optional: symbol kind (fn, struct, etc.)
created_at: i64Unix timestamp when chunk was created/updated
Implementations§
Trait Implementations§
Source§impl<'de> Deserialize<'de> for CodeChunk
impl<'de> Deserialize<'de> for CodeChunk
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>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for CodeChunk
impl StructuralPartialEq for CodeChunk
Auto Trait Implementations§
impl Freeze for CodeChunk
impl RefUnwindSafe for CodeChunk
impl Send for CodeChunk
impl Sync for CodeChunk
impl Unpin for CodeChunk
impl UnwindSafe for CodeChunk
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§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