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>
impl<'a> DocRef<'a>
Sourcepub fn pk_ref(&self) -> Option<&'a str>
pub fn pk_ref(&self) -> Option<&'a str>
Borrow the PK without copying. The returned slice is invalidated when the underlying document is destroyed.
pub fn doc_id(&self) -> u64
pub fn score(&self) -> f32
pub fn operator(&self) -> DocOperator
pub fn field_count(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn has_field(&self, name: &str) -> bool
pub fn has_field_value(&self, name: &str) -> bool
pub fn is_field_null(&self, name: &str) -> bool
pub fn memory_usage(&self) -> usize
pub fn field_names(&self) -> Result<Vec<String>>
Sourcepub fn get_basic<T: Copy>(&self, name: &str, ty: DataType) -> Result<T>
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.
pub fn get_int32(&self, name: &str) -> Result<i32>
pub fn get_int64(&self, name: &str) -> Result<i64>
pub fn get_uint32(&self, name: &str) -> Result<u32>
pub fn get_uint64(&self, name: &str) -> Result<u64>
pub fn get_float(&self, name: &str) -> Result<f32>
pub fn get_double(&self, name: &str) -> Result<f64>
pub fn get_bool(&self, name: &str) -> Result<bool>
Sourcepub fn get_copy(&self, name: &str, ty: DataType) -> Result<Vec<u8>>
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.
pub fn get_string(&self, name: &str) -> Result<Option<String>>
pub fn get_vector_fp32(&self, name: &str) -> Result<Vec<f32>>
pub fn get_vector_fp64(&self, name: &str) -> Result<Vec<f64>>
Sourcepub fn get_vector_fp16_bits(&self, name: &str) -> Result<Vec<u16>>
pub fn get_vector_fp16_bits(&self, name: &str) -> Result<Vec<u16>>
Retrieve an FP16 vector field as its raw 16-bit bit patterns.
Sourcepub fn get_vector_fp16(&self, name: &str) -> Result<Vec<f16>>
Available on crate feature half only.
pub fn get_vector_fp16(&self, name: &str) -> Result<Vec<f16>>
half only.Retrieve an FP16 vector field as Vec<half::f16>.
Available with the half cargo feature.
Sourcepub fn get_vector_int4_packed(&self, name: &str) -> Result<Vec<u8>>
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).
pub fn get_vector_binary32(&self, name: &str) -> Result<Vec<u32>>
pub fn get_vector_binary64(&self, name: &str) -> Result<Vec<u64>>
pub fn get_array_int32(&self, name: &str) -> Result<Vec<i32>>
pub fn get_array_int64(&self, name: &str) -> Result<Vec<i64>>
pub fn get_array_uint32(&self, name: &str) -> Result<Vec<u32>>
pub fn get_array_uint64(&self, name: &str) -> Result<Vec<u64>>
pub fn get_array_float(&self, name: &str) -> Result<Vec<f32>>
pub fn get_array_double(&self, name: &str) -> Result<Vec<f64>>
Trait Implementations§
impl<'a> Copy for DocRef<'a>
impl Send for DocRef<'_>
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> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more