pub struct GraphMetadata {
pub num_pts: u64,
pub dims: usize,
pub medoid: u64,
pub node_len: u64,
pub num_nodes_per_block: u64,
pub vamana_frozen_num: u64,
pub vamana_frozen_loc: u64,
pub disk_index_file_size: u64,
pub associated_data_length: usize,
}Expand description
Index graph metadata. The metadata is stored in the first sector of the disk index file, or the first segment of the BigStorageStream. The metadata is like a “header” of the index graph.
Fields§
§num_pts: u64§dims: usize§medoid: u64§node_len: u64§num_nodes_per_block: u64§vamana_frozen_num: u64§vamana_frozen_loc: u64§disk_index_file_size: u64§associated_data_length: usizeImplementations§
Source§impl GraphMetadata
impl GraphMetadata
Sourcepub fn new(
num_pts: u64,
dims: usize,
medoid: u64,
node_len: u64,
num_nodes_per_sector: u64,
vamana_frozen_num: u64,
vamana_frozen_loc: u64,
disk_index_file_size: u64,
data_size: usize,
) -> Self
pub fn new( num_pts: u64, dims: usize, medoid: u64, node_len: u64, num_nodes_per_sector: u64, vamana_frozen_num: u64, vamana_frozen_loc: u64, disk_index_file_size: u64, data_size: usize, ) -> Self
Create a new GraphMetadata object.
Sourcepub fn to_bytes(&self) -> ANNResult<Vec<u8>>
pub fn to_bytes(&self) -> ANNResult<Vec<u8>>
Serialize the GraphMetadata object to a byte vector.
Layout: |number_of_points (8 bytes)| dimensions (8 bytes) | medoid (8 bytes) | node_len (8 bytes) | num_nodes_per_sector (8 bytes) | vamana_frozen_point_num (8 bytes) | …| vamana_frozen_loc (8 bytes) | append_reorder_data (8 bytes) | disk_index_file_size (8 bytes) | associated_data_length (8 bytes) | The append_reorder_data is not used in the rust version. We are just keeping it in the stream to make the file based disk index layout consistent with the C++ version.
pub fn get_size() -> usize
Trait Implementations§
Source§impl Clone for GraphMetadata
impl Clone for GraphMetadata
Source§fn clone(&self) -> GraphMetadata
fn clone(&self) -> GraphMetadata
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for GraphMetadata
impl Debug for GraphMetadata
Source§impl<'a> TryFrom<&'a [u8]> for GraphMetadata
impl<'a> TryFrom<&'a [u8]> for GraphMetadata
Source§fn try_from(value: &'a [u8]) -> ANNResult<Self>
fn try_from(value: &'a [u8]) -> ANNResult<Self>
Try creating a new GraphMetadata object from a byte slice. The try_from syntax is used here instead of from because this operation can fail.
Layout: |number_of_points (8 bytes)| dimensions (8 bytes) | medoid (8 bytes) | node_len (8 bytes) | num_nodes_per_sector (8 bytes) | vamana_frozen_point_num (8 bytes) | …| vamana_frozen_loc (8 bytes) | append_reorder_data (8 bytes) | disk_index_file_size (8 bytes) | associated_data_length (8 bytes) |
Auto Trait Implementations§
impl Freeze for GraphMetadata
impl RefUnwindSafe for GraphMetadata
impl Send for GraphMetadata
impl Sync for GraphMetadata
impl Unpin for GraphMetadata
impl UnsafeUnpin for GraphMetadata
impl UnwindSafe for GraphMetadata
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
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>
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>
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