pub struct VecqView<'a> { /* private fields */ }Expand description
Read-only, zero-copy view over an index file (or any bytes in the same layout). Generic over the byte owner’s lifetime.
Implementations§
Source§impl<'a> VecqView<'a>
impl<'a> VecqView<'a>
Sourcepub fn from_bytes(bytes: &'a [u8]) -> Result<Self, Error>
pub fn from_bytes(bytes: &'a [u8]) -> Result<Self, Error>
Parse bytes as a vecq index file (v1.2+) without copying payloads.
v1 files (f32 scales) are not view-eligible: their scale blocks are
not the 2-byte layout shared by every current writer.
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn dim(&self) -> usize
pub fn working_dim(&self) -> usize
Sourcepub fn is_residual(&self) -> bool
pub fn is_residual(&self) -> bool
Whether the file carries a residual second pass (v1.4).
Sourcepub fn prepare_query(&self, q: &[f32]) -> ViewQuery
pub fn prepare_query(&self, q: &[f32]) -> ViewQuery
Prepare a query: truncate to working_dim, normalize, rotate, then
normalize again — mirroring the index-side prepare_query exactly so
both paths see identical rotated queries.
Auto Trait Implementations§
impl<'a> Freeze for VecqView<'a>
impl<'a> RefUnwindSafe for VecqView<'a>
impl<'a> Send for VecqView<'a>
impl<'a> Sync for VecqView<'a>
impl<'a> Unpin for VecqView<'a>
impl<'a> UnsafeUnpin for VecqView<'a>
impl<'a> UnwindSafe for VecqView<'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