pub struct GraphPostingList { /* private fields */ }Expand description
Posting list paired with a (doc_id -> GraphPayload) map. The
invariants of the underlying PostingList (sorted, unique doc ids)
hold here as well.
Implementations§
Source§impl GraphPostingList
impl GraphPostingList
pub fn new() -> Self
Sourcepub fn try_from_parts(
inner: PostingList,
graph_payloads: BTreeMap<DocId, GraphPayload>,
) -> GraphPostingListResult<Self>
pub fn try_from_parts( inner: PostingList, graph_payloads: BTreeMap<DocId, GraphPayload>, ) -> GraphPostingListResult<Self>
Construct a graph posting list while enforcing that every side-table key belongs to the underlying posting support.
Sourcepub fn to_posting_list(&self) -> PostingList
pub fn to_posting_list(&self) -> PostingList
Phi: encode the graph payload map onto the underlying posting
list’s payload fields. A versioned envelope preserves the original
score, graph name, exact override state, and any values that already
occupied reserved fields. Vertex and edge fields are also emitted as
legacy mirrors for existing posting-list consumers.
The result composes with the standard posting payload policies; invert
it with Self::from_posting_list to recover the graph view.
Sourcepub fn from_posting_list(pl: &PostingList) -> Self
pub fn from_posting_list(pl: &PostingList) -> Self
Phi^{-1}: decode the versioned envelope and rebuild the
(doc_id -> GraphPayload) side-table without losing the original
payload. The legacy two-field representation remains readable, though
values it never stored (graph name, base score, and None versus
Some) cannot be reconstructed from legacy input.
Sourcepub fn try_set_graph_payload(
&mut self,
doc_id: DocId,
payload: GraphPayload,
) -> GraphPostingListResult<()>
pub fn try_set_graph_payload( &mut self, doc_id: DocId, payload: GraphPayload, ) -> GraphPostingListResult<()>
Attach graph metadata to a document already present in the support.
pub fn get_graph_payload(&self, doc_id: DocId) -> Option<&GraphPayload>
pub fn inner(&self) -> &PostingList
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
Sourcepub fn merge_union(&self, other: &Self) -> GraphPostingListResult<Self>
pub fn merge_union(&self, other: &Self) -> GraphPostingListResult<Self>
Union document support and ordinary payloads, while taking the set union of overlapping subgraph vertices and edges.
Sourcepub fn merge_intersection(&self, other: &Self) -> GraphPostingListResult<Self>
pub fn merge_intersection(&self, other: &Self) -> GraphPostingListResult<Self>
Intersect document support and ordinary payloads, while taking the set intersection of overlapping subgraph vertices and edges.
Sourcepub fn merge_union_with(
&self,
other: &Self,
policy: SubgraphMergePolicy,
) -> GraphPostingListResult<Self>
pub fn merge_union_with( &self, other: &Self, policy: SubgraphMergePolicy, ) -> GraphPostingListResult<Self>
Union with an explicit graph-metadata collision policy.
Sourcepub fn merge_intersection_with(
&self,
other: &Self,
policy: SubgraphMergePolicy,
) -> GraphPostingListResult<Self>
pub fn merge_intersection_with( &self, other: &Self, policy: SubgraphMergePolicy, ) -> GraphPostingListResult<Self>
Intersection with an explicit graph-metadata collision policy.
pub fn exclude(&self, other: &Self) -> Self
Trait Implementations§
Source§impl Clone for GraphPostingList
impl Clone for GraphPostingList
Source§fn clone(&self) -> GraphPostingList
fn clone(&self) -> GraphPostingList
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more