pub struct VersionedVector {
pub id: VectorId,
pub current_version: u64,
pub base_snapshot: Vec<f32>,
pub base_version: u64,
pub deltas: VecDeque<VectorDelta>,
pub metadata: Option<Value>,
pub ttl_seconds: Option<u64>,
pub expires_at: Option<u64>,
}Expand description
A versioned vector with its delta history
Fields§
§id: VectorIdVector ID
current_version: u64Current version number
base_snapshot: Vec<f32>Base snapshot (full vector at some version)
base_version: u64Version of the base snapshot
deltas: VecDeque<VectorDelta>Chain of deltas from base to current
metadata: Option<Value>Metadata (preserved across versions)
ttl_seconds: Option<u64>TTL fields
expires_at: Option<u64>Implementations§
Source§impl VersionedVector
impl VersionedVector
Sourcepub fn reconstruct(&self) -> Vec<f32>
pub fn reconstruct(&self) -> Vec<f32>
Reconstruct the current vector values
Sourcepub fn reconstruct_at_version(&self, version: u64) -> Option<Vec<f32>>
pub fn reconstruct_at_version(&self, version: u64) -> Option<Vec<f32>>
Reconstruct vector at a specific version
Sourcepub fn size_bytes(&self) -> usize
pub fn size_bytes(&self) -> usize
Get the total size in bytes (estimated)
Sourcepub fn delta_chain_length(&self) -> usize
pub fn delta_chain_length(&self) -> usize
Get delta chain length
Trait Implementations§
Source§impl Clone for VersionedVector
impl Clone for VersionedVector
Source§fn clone(&self) -> VersionedVector
fn clone(&self) -> VersionedVector
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for VersionedVector
impl RefUnwindSafe for VersionedVector
impl Send for VersionedVector
impl Sync for VersionedVector
impl Unpin for VersionedVector
impl UnsafeUnpin for VersionedVector
impl UnwindSafe for VersionedVector
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<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more