MCPcopy Create free account
hub / github.com/NodeDB-Lab/nodedb / create_with_policy

Method create_with_policy

nodedb-vector/src/mmap_segment/reader.rs:65–73  ·  view source on GitHub ↗

Create a new segment with an explicit drop policy.

(
        path: &Path,
        dim: usize,
        vectors: &[&[f32]],
        policy: VectorSegmentDropPolicy,
    )

Source from the content-addressed store, hash-verified

63
64 /// Create a new segment with an explicit drop policy.
65 pub fn create_with_policy(
66 path: &Path,
67 dim: usize,
68 vectors: &[&[f32]],
69 policy: VectorSegmentDropPolicy,
70 ) -> std::io::Result<Self> {
71 write_segment(path, dim, vectors, &[])?;
72 Self::open_with_policy(path, policy)
73 }
74
75 /// Open an existing segment file and memory-map it.
76 pub fn open(path: &Path) -> std::io::Result<Self> {

Callers

nothing calls this directly

Calls 1

write_segmentFunction · 0.70

Tested by

no test coverage detected