Skip to main content

DocRef

Struct DocRef 

Source
pub struct DocRef<'a> { /* private fields */ }
Expand description

Non-owning document reference (e.g. rows returned from a query).

Implementations§

Source§

impl<'a> DocRef<'a>

Source

pub fn pk_ref(&self) -> Option<&'a str>

Borrow the PK without copying. The returned slice is invalidated when the underlying document is destroyed.

Source

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

Copy the PK into an owned String.

Source

pub fn doc_id(&self) -> u64

Source

pub fn score(&self) -> f32

Source

pub fn operator(&self) -> DocOperator

Source

pub fn field_count(&self) -> usize

Source

pub fn is_empty(&self) -> bool

Source

pub fn has_field(&self, name: &str) -> bool

Source

pub fn has_field_value(&self, name: &str) -> bool

Source

pub fn is_field_null(&self, name: &str) -> bool

Source

pub fn memory_usage(&self) -> usize

Source

pub fn field_names(&self) -> Result<Vec<String>>

Source

pub fn get_basic<T: Copy>(&self, name: &str, ty: DataType) -> Result<T>

Fetch a field value into a buffer using the “basic” variant — supports BOOL / INT32 / INT64 / UINT32 / UINT64 / FLOAT / DOUBLE.

Source

pub fn get_int32(&self, name: &str) -> Result<i32>

Source

pub fn get_int64(&self, name: &str) -> Result<i64>

Source

pub fn get_uint32(&self, name: &str) -> Result<u32>

Source

pub fn get_uint64(&self, name: &str) -> Result<u64>

Source

pub fn get_float(&self, name: &str) -> Result<f32>

Source

pub fn get_double(&self, name: &str) -> Result<f64>

Source

pub fn get_bool(&self, name: &str) -> Result<bool>

Source

pub fn get_copy(&self, name: &str, ty: DataType) -> Result<Vec<u8>>

Copy a field value (for variable-size types). Returns raw bytes which the caller can reinterpret.

Source

pub fn get_string(&self, name: &str) -> Result<Option<String>>

Source

pub fn get_vector_fp32(&self, name: &str) -> Result<Vec<f32>>

Source

pub fn get_vector_fp64(&self, name: &str) -> Result<Vec<f64>>

Source

pub fn get_vector_int8(&self, name: &str) -> Result<Vec<i8>>

Retrieve an INT8 vector field.

Source

pub fn get_vector_int16(&self, name: &str) -> Result<Vec<i16>>

Retrieve an INT16 vector field.

Source

pub fn get_vector_fp16_bits(&self, name: &str) -> Result<Vec<u16>>

Retrieve an FP16 vector field as its raw 16-bit bit patterns.

Source

pub fn get_vector_fp16(&self, name: &str) -> Result<Vec<f16>>

Available on crate feature half only.

Retrieve an FP16 vector field as Vec<half::f16>.

Available with the half cargo feature.

Source

pub fn get_vector_int4_packed(&self, name: &str) -> Result<Vec<u8>>

Retrieve a nibble-packed INT4 vector field as raw bytes (2 values per byte).

Source

pub fn get_vector_binary32(&self, name: &str) -> Result<Vec<u32>>

Source

pub fn get_vector_binary64(&self, name: &str) -> Result<Vec<u64>>

Source

pub fn get_array_int32(&self, name: &str) -> Result<Vec<i32>>

Source

pub fn get_array_int64(&self, name: &str) -> Result<Vec<i64>>

Source

pub fn get_array_uint32(&self, name: &str) -> Result<Vec<u32>>

Source

pub fn get_array_uint64(&self, name: &str) -> Result<Vec<u64>>

Source

pub fn get_array_float(&self, name: &str) -> Result<Vec<f32>>

Source

pub fn get_array_double(&self, name: &str) -> Result<Vec<f64>>

Source

pub fn get_binary(&self, name: &str) -> Result<Vec<u8>>

Retrieve a binary field (opaque bytes). Suitable for DataType::Binary.

Trait Implementations§

Source§

impl<'a> Clone for DocRef<'a>

Source§

fn clone(&self) -> DocRef<'a>

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<'a> Copy for DocRef<'a>

Source§

impl Send for DocRef<'_>

Source§

impl Sync for DocRef<'_>

Auto Trait Implementations§

§

impl<'a> Freeze for DocRef<'a>

§

impl<'a> RefUnwindSafe for DocRef<'a>

§

impl<'a> Unpin for DocRef<'a>

§

impl<'a> UnsafeUnpin for DocRef<'a>

§

impl<'a> UnwindSafe for DocRef<'a>

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.