pub struct PublishedContext(/* private fields */);Expand description
What a tool published into its dispatch context, handed back beside the
sink rather than on the wire: the driver attaches an empty one to the
sink’s scope (Dispatch::with_scope), the adapter fills it once the
tool ran, the driver reads it after the outcome. One per dispatch; a
second publish replaces the first.
Implementations§
Source§impl PublishedContext
impl PublishedContext
Sourcepub fn new() -> Arc<PublishedContext> ⓘ
pub fn new() -> Arc<PublishedContext> ⓘ
An empty one, shared between the driver and the sink.
Sourcepub fn result_context(&self) -> Option<ToolResultContext>
pub fn result_context(&self) -> Option<ToolResultContext>
The recorder’s non-consuming snapshot. Publish before resolving the sink; values published after resolution are not part of that outcome.
Sourcepub fn publish(&self, context: ToolContext)
pub fn publish(&self, context: ToolContext)
The adapter’s write: the context after the tool ran, scopes cleared. All publication must finish before resolving the sink. Publishing afterward violates the delivery contract: consumers and recorders may observe different versions. The slot does not enforce this ordering.
Sourcepub fn take(&self) -> Option<ToolContext>
pub fn take(&self) -> Option<ToolContext>
The driver’s read: what was published, if anything, leaving nothing.