pub struct Chunk {
pub id: String,
pub content: String,
pub source: DocumentSource,
pub chunk_index: usize,
pub tenant_id: Option<String>,
}Expand description
Atomic search unit: a slice of a document.
Fields§
§id: StringDeterministic ID derived from source URI + chunk index.
content: StringThe text content of this chunk.
source: DocumentSourceWhere this chunk came from.
chunk_index: usizePosition of this chunk within its source document (0-based).
tenant_id: Option<String>Tenant that owns this chunk. None means single-tenant (legacy).
SECURITY (F-KB-1): in a multi-tenant deployment, this MUST be set to
Some(tenant_id) so cross-tenant searches do not return another
tenant’s documents. The KnowledgeBase implementations filter
by this field on search.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Chunk
impl<'de> Deserialize<'de> for Chunk
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
Auto Trait Implementations§
impl Freeze for Chunk
impl RefUnwindSafe for Chunk
impl Send for Chunk
impl Sync for Chunk
impl Unpin for Chunk
impl UnsafeUnpin 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
Mutably borrows from an owned value. Read more