pub struct EncodeResult {
pub model: Option<String>,
pub id: Option<String>,
pub dense: Option<Vec<f32>>,
pub sparse: Option<SparseVector>,
pub multivector: Option<Multivector>,
pub timing: Option<TimingInfo>,
pub request: Option<RequestMetadata>,
}Expand description
One encoded item.
Fields§
§model: Option<String>§id: Option<String>Echoed from the request item, when it carried an id.
dense: Option<Vec<f32>>§sparse: Option<SparseVector>§multivector: Option<Multivector>§timing: Option<TimingInfo>§request: Option<RequestMetadata>Implementations§
Source§impl EncodeResult
impl EncodeResult
Sourcepub fn require_dense(&self) -> Result<&[f32]>
pub fn require_dense(&self) -> Result<&[f32]>
The dense embedding, or an error naming what is missing.
Use the dense field directly when its absence is expected.
Sourcepub fn sparse_map(&self) -> HashMap<u32, f32>
pub fn sparse_map(&self) -> HashMap<u32, f32>
The sparse embedding as a {term_id: weight} map, empty when there is none.
Sourcepub fn multivector_f32(&self) -> Vec<Vec<f32>>
pub fn multivector_f32(&self) -> Vec<Vec<f32>>
The multivector widened to f32 rows, empty when there is none.
Trait Implementations§
Source§impl Clone for EncodeResult
impl Clone for EncodeResult
Source§fn clone(&self) -> EncodeResult
fn clone(&self) -> EncodeResult
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for EncodeResult
impl Debug for EncodeResult
Source§impl Default for EncodeResult
impl Default for EncodeResult
Source§fn default() -> EncodeResult
fn default() -> EncodeResult
Returns the “default value” for a type. Read more
Source§impl PartialEq for EncodeResult
impl PartialEq for EncodeResult
impl StructuralPartialEq for EncodeResult
Auto Trait Implementations§
impl Freeze for EncodeResult
impl RefUnwindSafe for EncodeResult
impl Send for EncodeResult
impl Sync for EncodeResult
impl Unpin for EncodeResult
impl UnsafeUnpin for EncodeResult
impl UnwindSafe for EncodeResult
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