pub struct UnifiedQuantizedVectorRef<'a> { /* private fields */ }Expand description
Zero-copy borrowed view into a UnifiedQuantizedVector buffer.
Suitable for reads from the io_uring page cache — no allocation required.
Implementations§
Source§impl<'a> UnifiedQuantizedVectorRef<'a>
impl<'a> UnifiedQuantizedVectorRef<'a>
Sourcepub fn from_bytes(
buf: &'a [u8],
packed_bits_len: usize,
) -> Result<Self, CodecError>
pub fn from_bytes( buf: &'a [u8], packed_bits_len: usize, ) -> Result<Self, CodecError>
Borrow a raw byte slice as a quantized vector view.
§Errors
Returns CodecError::LayoutError if the slice is shorter than 32 bytes
(minimum header size).
Sourcepub fn header(&self) -> &QuantHeader
pub fn header(&self) -> &QuantHeader
Zero-copy header reference.
Sourcepub fn packed_bits(&self) -> &[u8] ⓘ
pub fn packed_bits(&self) -> &[u8] ⓘ
Packed-bits slice.
Sourcepub fn outlier_count(&self) -> u32
pub fn outlier_count(&self) -> u32
Number of outlier entries via popcnt.
Sourcepub fn outlier_at(&self, slot: u32) -> Option<(u32, f32)>
pub fn outlier_at(&self, slot: u32) -> Option<(u32, f32)>
Outlier lookup — same semantics as UnifiedQuantizedVector::outlier_at.
Auto Trait Implementations§
impl<'a> Freeze for UnifiedQuantizedVectorRef<'a>
impl<'a> RefUnwindSafe for UnifiedQuantizedVectorRef<'a>
impl<'a> Send for UnifiedQuantizedVectorRef<'a>
impl<'a> Sync for UnifiedQuantizedVectorRef<'a>
impl<'a> Unpin for UnifiedQuantizedVectorRef<'a>
impl<'a> UnsafeUnpin for UnifiedQuantizedVectorRef<'a>
impl<'a> UnwindSafe for UnifiedQuantizedVectorRef<'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
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.