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.
Auto Trait Implementations§
impl !RefUnwindSafe for DocumentFieldSession
impl !Send for DocumentFieldSession
impl !Sync for DocumentFieldSession
impl !UnwindSafe for DocumentFieldSession
impl Freeze for DocumentFieldSession
impl Unpin for DocumentFieldSession
impl UnsafeUnpin for DocumentFieldSession
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