Skip to main content

Transport

Trait Transport 

Source
pub trait Transport: Send + Sync {
    // Required method
    fn dispatch(
        &self,
        plan: &Plan,
        cargo: &Cargo<'_>,
        seen: Option<&dyn Watcher>,
    ) -> Result<Outcome, TransportError>;
}
Expand description

Knows how to execute a plan elsewhere.

Required Methods§

Source

fn dispatch( &self, plan: &Plan, cargo: &Cargo<'_>, seen: Option<&dyn Watcher>, ) -> Result<Outcome, TransportError>

Executes plan over there, with what it needs in order to do so, and tells seen whatever the far side says while it is at it.

A Value::Opaque has to fail here: it carries something that only exists in this process.

§Why seen is an argument and not a field of either

It is not in Cargo because everything in a Cargo travels, and a watcher is injected and stays. And it is not given to the transport when the transport is built because a worker is opened once and used for many runs, while a watcher belongs to one run. A watcher is of the call, so it goes in the call.

Whatever comes back is passed on as it was emitted: saying where it happened is the engine’s, which is the only one that knows the host by the name the graph gave it.

Implementors§