pub struct ProofTreeStreamer { /* private fields */ }Expand description
Streams partial proof tree updates as nodes resolve.
Implementations§
Source§impl ProofTreeStreamer
impl ProofTreeStreamer
Sourcepub fn new(
session_id: impl Into<String>,
sink: Arc<ProofTreeUpdateSink>,
) -> Self
pub fn new( session_id: impl Into<String>, sink: Arc<ProofTreeUpdateSink>, ) -> Self
Create a new streamer bound to session_id and sink.
Sourcepub fn session_id(&self) -> &str
pub fn session_id(&self) -> &str
Return the session identifier for this streamer.
Sourcepub fn emit_resolved(&self, goal: &str, depth: usize, peer: Option<String>)
pub fn emit_resolved(&self, goal: &str, depth: usize, peer: Option<String>)
Emit an update for a successfully resolved node.
Sourcepub fn emit_unresolved(&self, goal: &str, depth: usize)
pub fn emit_unresolved(&self, goal: &str, depth: usize)
Emit an update for a node that could not be resolved.
Sourcepub fn emit_final(
&self,
goal: &str,
depth: usize,
resolved: bool,
peer: Option<String>,
)
pub fn emit_final( &self, goal: &str, depth: usize, resolved: bool, peer: Option<String>, )
Emit the final summary update, marking the session as complete.
Sourcepub fn stream_tree(&self, tree: &ProofTree)
pub fn stream_tree(&self, tree: &ProofTree)
Walk a completed crate::proof_tree::ProofTree and emit one update
per node in BFS (pre-order breadth-first) order, followed by a final
update that reflects the overall tree completion status.
Auto Trait Implementations§
impl !Freeze for ProofTreeStreamer
impl RefUnwindSafe for ProofTreeStreamer
impl Send for ProofTreeStreamer
impl Sync for ProofTreeStreamer
impl Unpin for ProofTreeStreamer
impl UnsafeUnpin for ProofTreeStreamer
impl UnwindSafe for ProofTreeStreamer
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
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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>
Converts
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>
Converts
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