Skip to main content

GraphPostingList

Struct GraphPostingList 

Source
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

Source

pub fn new() -> Self

Source

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.

Source

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.

Source

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.

Source

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.

Source

pub fn get_graph_payload(&self, doc_id: DocId) -> Option<&GraphPayload>

Source

pub fn inner(&self) -> &PostingList

Source

pub fn len(&self) -> usize

Source

pub fn is_empty(&self) -> bool

Source

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.

Source

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.

Source

pub fn merge_union_with( &self, other: &Self, policy: SubgraphMergePolicy, ) -> GraphPostingListResult<Self>

Union with an explicit graph-metadata collision policy.

Source

pub fn merge_intersection_with( &self, other: &Self, policy: SubgraphMergePolicy, ) -> GraphPostingListResult<Self>

Intersection with an explicit graph-metadata collision policy.

Source

pub fn exclude(&self, other: &Self) -> Self

Trait Implementations§

Source§

impl Clone for GraphPostingList

Source§

fn clone(&self) -> GraphPostingList

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for GraphPostingList

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for GraphPostingList

Source§

fn default() -> GraphPostingList

Returns the “default value” for a type. Read more
Source§

impl PartialEq for GraphPostingList

Source§

fn eq(&self, other: &GraphPostingList) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for GraphPostingList

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.