pub struct ContentChunk {Show 13 fields
pub file_path: String,
pub symbol_name: String,
pub kind: ChunkKind,
pub start_line: usize,
pub end_line: usize,
pub content: String,
pub tokens: Vec<String>,
pub token_count: usize,
pub source: ContentSource,
pub references: Vec<String>,
pub metadata: Option<Value>,
pub origin: Option<ProviderOrigin>,
pub input_origin: Option<InputOrigin>,
}Expand description
A universal content chunk that can represent code, issues, DB schemas, wiki pages, or any other data source.
Fields§
§file_path: String§symbol_name: String§kind: ChunkKind§start_line: usize§end_line: usize§content: String§tokens: Vec<String>§token_count: usize§source: ContentSource§references: Vec<String>URIs or file paths that this chunk references (for cross-source graph edges).
metadata: Option<Value>Provider-specific structured metadata.
origin: Option<ProviderOrigin>§input_origin: Option<InputOrigin>The untrusted origin of provider text (pz21 §1.6). None for a
project file; a scheme:// chunk without it is read as unknown.
Implementations§
Source§impl ContentChunk
impl ContentChunk
pub fn from_provider( provider_id: &str, resource_type: &str, item_id: &str, title: &str, kind: ChunkKind, content: String, references: Vec<String>, metadata: Option<Value>, ) -> ContentChunk
pub fn is_external(&self) -> bool
pub fn provider_id(&self) -> Option<&str>
Trait Implementations§
Source§impl Clone for ContentChunk
impl Clone for ContentChunk
Source§fn clone(&self) -> ContentChunk
fn clone(&self) -> ContentChunk
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 ContentChunk
impl Debug for ContentChunk
Source§impl<'de> Deserialize<'de> for ContentChunk
impl<'de> Deserialize<'de> for ContentChunk
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<ContentChunk, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<ContentChunk, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl From<CodeChunk> for ContentChunk
impl From<CodeChunk> for ContentChunk
Source§fn from(c: CodeChunk) -> ContentChunk
fn from(c: CodeChunk) -> ContentChunk
Converts to this type from the input type.
Source§impl From<ContentChunk> for CodeChunk
impl From<ContentChunk> for CodeChunk
Source§fn from(c: ContentChunk) -> CodeChunk
fn from(c: ContentChunk) -> CodeChunk
Converts to this type from the input type.
Source§impl Serialize for ContentChunk
impl Serialize for ContentChunk
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
Auto Trait Implementations§
impl Forget for ContentChunk
impl Freeze for ContentChunkwhere
*const u8 is !null: Freeze,
PhantomData<u8>: Freeze,
PhantomData<String>: Freeze,
PhantomData<Value>: Freeze,
*const LeafNode<String, Value> is !null: Freeze,
PhantomData<(Owned, LeafOrInternal)>: Freeze,
PhantomData<Box<(String, Value)>>: Freeze,
impl Move for ContentChunk
impl RefUnwindSafe for ContentChunk
impl Send for ContentChunk
impl Sync for ContentChunk
impl Unpin for ContentChunk
impl UnsafeUnpin for ContentChunkwhere
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
PhantomData<String>: UnsafeUnpin,
PhantomData<Value>: UnsafeUnpin,
*const LeafNode<String, Value> is !null: UnsafeUnpin,
PhantomData<(Owned, LeafOrInternal)>: UnsafeUnpin,
PhantomData<Box<(String, Value)>>: UnsafeUnpin,
impl UnwindSafe for ContentChunk
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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> ⓘ
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