Skip to main content

PumpBox

Trait PumpBox 

Source
pub trait PumpBox {
    // Required method
    fn run(
        &self,
        ctx: &Ctx<'_>,
        order: &SignedOrder,
        ask: &mut dyn Asker,
    ) -> OrderAck;

    // Provided methods
    fn health(&self) -> BTreeMap<String, String> { ... }
    fn product_report(&self) -> Option<String> { ... }
    fn own_review(&self) -> Option<String> { ... }
}
Expand description

The product’s half of the pump: what its box reports, and what it does with an order.

Required Methods§

Source

fn run( &self, ctx: &Ctx<'_>, order: &SignedOrder, ask: &mut dyn Asker, ) -> OrderAck

Run one order that passed check (signed by monetize, for this box, newer, in its window): decode its body, run it through the product’s own verbs, and answer its ack. A kind or body the product does not take is an ack not-ok, by name. ask is Fleet.Ask on the order’s own link (grow_set).

Provided Methods§

Source

fn health(&self) -> BTreeMap<String, String>

The box’s health words for Fleet.Report (serving, data, serves_at, twin, epoch).

Source

fn product_report(&self) -> Option<String>

monetize_product::pull::ProductReport as JSON — the main that serves sends it.

Source

fn own_review(&self) -> Option<String>

A twin reviews itself on every report (G12): its review as JSON.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<B, T> PumpBox for Pumped<B>
where B: Deref<Target = T>, T: HolgerBox + ?Sized,