[][src]Struct tantivy::postings::FieldSerializer

pub struct FieldSerializer<'a> { /* fields omitted */ }

The field serializer is in charge of the serialization of a specific field.

Methods

impl<'a> FieldSerializer<'a>[src]

pub fn new_term(&mut self, term: &[u8]) -> Result<TermOrdinal>[src]

Starts the postings for a new term.

  • term - the term. It needs to come after the previous term according to the lexicographical order.
  • doc_freq - return the number of document containing the term.

pub fn write_doc(
    &mut self,
    doc_id: DocId,
    term_freq: u32,
    position_deltas: &[u32]
) -> Result<()>
[src]

Serialize the information that a document contains the current term, its term frequency, and the position deltas.

At this point, the positions are already delta-encoded. For instance, if the positions are 2, 3, 17, position_deltas is 2, 1, 14

Term frequencies and positions may be ignored by the serializer depending on the configuration of the field in the Schema.

pub fn close_term(&mut self) -> Result<()>[src]

Finish the serialization for this term postings.

If the current block is incomplete, it need to be encoded using VInt encoding.

pub fn close(self) -> Result<()>[src]

Closes the current current field.

Auto Trait Implementations

impl<'a> !Send for FieldSerializer<'a>

impl<'a> Unpin for FieldSerializer<'a>

impl<'a> !Sync for FieldSerializer<'a>

impl<'a> !UnwindSafe for FieldSerializer<'a>

impl<'a> !RefUnwindSafe for FieldSerializer<'a>

Blanket Implementations

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Erased for T[src]

impl<T> Downcast for T where
    T: Any
[src]