Skip to main content

FieldSchema

Struct FieldSchema 

Source
pub struct FieldSchema { /* private fields */ }

Implementations§

Source§

impl FieldSchema

Typed constructors for FieldSchemaBuilder.

These cover the data types commonly used in documents; for rarer types call FieldSchema::custom or build a FieldSchema directly with FieldSchema::new.

Source

pub fn string(name: impl Into<String>) -> FieldSchemaBuilder

Source

pub fn binary(name: impl Into<String>) -> FieldSchemaBuilder

Source

pub fn bool(name: impl Into<String>) -> FieldSchemaBuilder

Source

pub fn int32(name: impl Into<String>) -> FieldSchemaBuilder

Source

pub fn int64(name: impl Into<String>) -> FieldSchemaBuilder

Source

pub fn uint32(name: impl Into<String>) -> FieldSchemaBuilder

Source

pub fn uint64(name: impl Into<String>) -> FieldSchemaBuilder

Source

pub fn float(name: impl Into<String>) -> FieldSchemaBuilder

Source

pub fn double(name: impl Into<String>) -> FieldSchemaBuilder

Source

pub fn vector_fp32(name: impl Into<String>, dim: u32) -> FieldSchemaBuilder

Source

pub fn vector_fp64(name: impl Into<String>, dim: u32) -> FieldSchemaBuilder

Source

pub fn vector_fp16(name: impl Into<String>, dim: u32) -> FieldSchemaBuilder

Source

pub fn vector_int8(name: impl Into<String>, dim: u32) -> FieldSchemaBuilder

Source

pub fn vector_int16(name: impl Into<String>, dim: u32) -> FieldSchemaBuilder

Source

pub fn vector_int4(name: impl Into<String>, dim: u32) -> FieldSchemaBuilder

Source

pub fn custom( name: impl Into<String>, data_type: DataType, dimension: u32, ) -> FieldSchemaBuilder

Escape hatch for any other DataType.

Source§

impl FieldSchema

Source

pub fn new( name: &str, data_type: DataType, nullable: bool, dimension: u32, ) -> Result<Self>

Source

pub fn borrow(&self) -> FieldSchemaRef<'_>

Borrow as a non-owning FieldSchemaRef.

Source

pub fn name(&self) -> Option<String>

Source

pub fn set_name(&mut self, name: &str) -> Result<()>

Source

pub fn data_type(&self) -> DataType

Source

pub fn set_data_type(&mut self, t: DataType) -> Result<()>

Source

pub fn element_data_type(&self) -> DataType

Source

pub fn element_data_size(&self) -> usize

Source

pub fn is_vector_field(&self) -> bool

Source

pub fn is_dense_vector(&self) -> bool

Source

pub fn is_sparse_vector(&self) -> bool

Source

pub fn is_nullable(&self) -> bool

Source

pub fn set_nullable(&mut self, nullable: bool) -> Result<()>

Source

pub fn has_invert_index(&self) -> bool

Source

pub fn is_array_type(&self) -> bool

Source

pub fn dimension(&self) -> u32

Source

pub fn set_dimension(&mut self, d: u32) -> Result<()>

Source

pub fn index_type(&self) -> IndexType

Source

pub fn has_index(&self) -> bool

Source

pub fn set_index_params(&mut self, params: &IndexParams) -> Result<()>

Install a (deep-copied) index parameters object on this field.

Source

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

Trait Implementations§

Source§

impl Drop for FieldSchema

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

impl Send for FieldSchema

Source§

impl Sync for FieldSchema

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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.