pub struct DocumentFieldSession { /* private fields */ }Expand description
One process serving many observations against one field.
The store and field are opened once (open); every observe then
reuses that open field and the derived-cache probe, so manifest/descriptor
reads, their content-id BLAKE3 checks, the descriptor parse, and the typed
model decodes are paid once rather than per observation.
Implementations§
Source§impl DocumentFieldSession
impl DocumentFieldSession
Sourcepub fn open(
store_dir: &Path,
field_hex: &str,
opts: SessionOptions,
) -> Result<Self>
pub fn open( store_dir: &Path, field_hex: &str, opts: SessionOptions, ) -> Result<Self>
Open the store and the field once. Does the manifest read + content_id BLAKE3, descriptor read + Id::of BLAKE3 + Descriptor::parse, and the FieldId hex parse exactly once.
Sourcepub fn observe(
&mut self,
req: &ObserveRequest,
limits: Limits,
) -> Result<(FieldAnswer, ObserveStats, FieldId)>
pub fn observe( &mut self, req: &ObserveRequest, limits: Limits, ) -> Result<(FieldAnswer, ObserveStats, FieldId)>
One observation. &mut self.store, &self.field, &self.index, and a
clone of the Rc-based memo are disjoint field borrows in one call.
Sourcepub fn observe_batch(
&mut self,
reqs: &[ObserveRequest],
limits: Limits,
) -> Vec<Result<(FieldAnswer, ObserveStats, FieldId)>> ⓘ
pub fn observe_batch( &mut self, reqs: &[ObserveRequest], limits: Limits, ) -> Vec<Result<(FieldAnswer, ObserveStats, FieldId)>> ⓘ
N observations in one process, in order.
Sourcepub fn source_exact(&self, limits: Limits) -> Result<Vec<u8>>
pub fn source_exact(&self, limits: Limits) -> Result<Vec<u8>>
The exact original source bytes, materialized from the field’s own
exact authority (the descriptor it was built from), not by re-opening the
original source file. This is the substrate a fused kernel reads: it is the
same byte-authority as materialize --exact, and it is off the observation
path (it is never consulted by, and never changes, observe).