Skip to main content

FieldSchema

Struct FieldSchema 

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

Schema definition for a single field in a collection.

Implementations§

Source§

impl FieldSchema

Source

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

Creates a new field schema.

  • name: Field name
  • data_type: Data type of the field
  • nullable: Whether the field can be null
  • dimension: Vector dimension (0 for non-vector fields)
Source

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

Sets the index parameters for this field.

Source

pub fn name(&self) -> &str

Returns the field name.

Source

pub fn data_type(&self) -> DataType

Returns the data type.

Source

pub fn dimension(&self) -> u32

Returns the dimension (for vector fields).

Source

pub fn is_nullable(&self) -> bool

Returns whether the field is nullable.

Source

pub fn is_vector_field(&self) -> bool

Returns whether this is a vector field.

Source

pub fn is_dense_vector(&self) -> bool

Returns whether this is a dense vector field.

Source

pub fn is_sparse_vector(&self) -> bool

Returns whether this is a sparse vector field.

Source

pub fn has_index(&self) -> bool

Returns whether this field has an index.

Source

pub fn index_type(&self) -> IndexType

Returns the index type.

Source

pub fn is_array_type(&self) -> bool

Returns whether this is an array type.

Trait Implementations§

Source§

impl Drop for FieldSchema

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

fn pin_drop(self: Pin<&mut Self>)

🔬This is a nightly-only experimental API. (pin_ergonomics)
Execute the destructor for this type, but different to Drop::drop, it requires self to be pinned. Read more

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.