pub struct SerializedGraph {
pub m: usize,
pub num_nodes: usize,
pub entry_point: Option<u32>,
pub max_level: usize,
pub vectors: Vec<f32>,
pub dim: usize,
pub neighbors: Vec<u32>,
}Expand description
Serialized HNSW graph for persistence.
Contains all data needed to reconstruct the graph.
Fields§
§m: usizeConfiguration.
num_nodes: usizeNumber of nodes.
entry_point: Option<u32>Entry point node ID.
max_level: usizeMaximum level in the graph.
vectors: Vec<f32>All vectors (flattened: [node_0_dim_0, node_0_dim_1, ..., node_1_dim_0, ...]).
dim: usizeVector dimensionality.
neighbors: Vec<u32>Neighbor lists: [node_0_level_0, node_0_level_1, ..., node_1_level_0, ...]
Encoded as: for each node, number of levels, then for each level, count + neighbor IDs.
Trait Implementations§
Source§impl Clone for SerializedGraph
impl Clone for SerializedGraph
Source§fn clone(&self) -> SerializedGraph
fn clone(&self) -> SerializedGraph
Returns a copy 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 moreSource§impl Debug for SerializedGraph
impl Debug for SerializedGraph
Source§impl<'de> Deserialize<'de> for SerializedGraph
impl<'de> Deserialize<'de> for SerializedGraph
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for SerializedGraph
impl RefUnwindSafe for SerializedGraph
impl Send for SerializedGraph
impl Sync for SerializedGraph
impl Unpin for SerializedGraph
impl UnwindSafe for SerializedGraph
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> 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