pub struct JeNetworkEdgeBuilder { /* private fields */ }Expand description
v5.31 C1 Phase 6 — stateful, JE-at-a-time edge builder.
Maintains the line_id → edge_id mapping across push_je calls so
cross-JE predecessor chains within an entity (e.g. payment-JE →
invoice-JE → PO-JE document chains) resolve correctly even when
the caller streams JEs one at a time rather than passing them as
a single slice to build_je_network_edges.
Use this when the caller wants to feed JEs from a streaming JSON
parse (or other streaming source) without materialising the whole
Vec<JournalEntry> in memory. The accumulated edges Vec grows as
push_je is called and can be drained at any point via
Self::drain_edges.
Equivalent to calling build_je_network_edges with the same JEs
passed as one slice — byte-identical output (same edge IDs, same
predecessor resolution, same iteration order).
Implementations§
Source§impl JeNetworkEdgeBuilder
impl JeNetworkEdgeBuilder
Sourcepub fn new(method: JeNetworkMethod) -> Self
pub fn new(method: JeNetworkMethod) -> Self
Create a builder with the given method and zero initial capacity.
Sourcepub fn with_capacity(method: JeNetworkMethod, capacity: usize) -> Self
pub fn with_capacity(method: JeNetworkMethod, capacity: usize) -> Self
Create a builder pre-sized for the expected total edge count.
Sourcepub fn push_je(&mut self, je: &JournalEntry)
pub fn push_je(&mut self, je: &JournalEntry)
Process one JE — append its edges to the internal edges vector,
resolving predecessor_line_id against the line→edge map built
from prior push_je calls.
Sourcepub fn drain_edges(&mut self) -> Vec<JeNetworkEdge>
pub fn drain_edges(&mut self) -> Vec<JeNetworkEdge>
Take the accumulated edges, leaving the builder empty (the line→edge map is also cleared).
Sourcepub fn into_edges(self) -> Vec<JeNetworkEdge>
pub fn into_edges(self) -> Vec<JeNetworkEdge>
Consume the builder and return the accumulated edges.
Sourcepub fn edge_count(&self) -> usize
pub fn edge_count(&self) -> usize
Current edge count (useful for batched flushes from the streaming caller).
Auto Trait Implementations§
impl Freeze for JeNetworkEdgeBuilder
impl RefUnwindSafe for JeNetworkEdgeBuilder
impl Send for JeNetworkEdgeBuilder
impl Sync for JeNetworkEdgeBuilder
impl Unpin for JeNetworkEdgeBuilder
impl UnsafeUnpin for JeNetworkEdgeBuilder
impl UnwindSafe for JeNetworkEdgeBuilder
Blanket Implementations§
impl<T> Allocation for T
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> 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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.