Skip to main content

DocumentFieldSession

Struct DocumentFieldSession 

Source
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

Source

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.

Source

pub fn field_id(&self) -> FieldId

The field this session serves.

Source

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.

Source

pub fn observe_batch( &mut self, reqs: &[ObserveRequest], limits: Limits, ) -> Vec<Result<(FieldAnswer, ObserveStats, FieldId)>> ⓘ

N observations in one process, in order.

Source

pub fn sync(&self) -> Result<()>

EntropyFS epoch barrier; no-op on the filesystem backend.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.