Struct tantivy::fieldnorm::FieldNormsWriter[][src]

pub struct FieldNormsWriter { /* fields omitted */ }

The FieldNormsWriter is in charge of tracking the fieldnorm byte of each document for each field with field norms.

FieldNormsWriter stores a Vec for each tracked field, using a byte per document per field.

Implementations

impl FieldNormsWriter[src]

pub fn for_schema(schema: &Schema) -> FieldNormsWriter[src]

Initialize with state for tracking the field norm fields specified in the schema.

pub fn fill_up_to_max_doc(&mut self, max_doc: DocId)[src]

Ensure that all documents in 0..max_doc have a byte associated with them in each of the fieldnorm vectors.

Will extend with 0-bytes for documents that have not been seen.

pub fn record(&mut self, doc: DocId, field: Field, fieldnorm: u32)[src]

Set the fieldnorm byte for the given document for the given field.

Will internally convert the u32 fieldnorm value to the appropriate byte to approximate the field norm in less space.

  • doc - the document id
  • field - the field being set
  • fieldnorm - the number of terms present in document doc in field field

pub fn serialize(
    &self,
    mut fieldnorms_serializer: FieldNormsSerializer
) -> Result<()>
[src]

Serialize the seen fieldnorm values to the serializer for all fields.

Auto Trait Implementations

Blanket Implementations

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

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

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

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

impl<T> DowncastSync for T where
    T: Send + Sync + Any
[src]

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

impl<T> Fruit for T where
    T: Send + Downcast
[src]

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

impl<T> Pointable for T

type Init = T

The type for initializers.

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<V, T> VZip<V> for T where
    V: MultiLane<T>,