pub enum Request {
Hello {
runtime: String,
offering: Option<Label>,
},
Provision {
bytes: Vec<u8>,
},
Work {
plan: Plan,
input: Value,
known: Vec<(NodeId, Value)>,
keys: Vec<(NodeId, Keys)>,
placement: Placement,
memory: Memory,
},
}Expand description
What the client says.
The allow is deliberate: Work is far bigger than Hello, and boxing it
would buy an allocation on every message to save a few hundred bytes of
stack on one that is about to be serialized anyway — and Hello is sent
once per session while Work is the whole conversation.
Variants§
Hello
Opens the session: who I am and what I would provision you with.
Fields
Provision
Here is the artifact, since you asked for it.
Work
Execute this.
Fields
plan: PlanWhat gets executed.
input: ValueThe graph’s input.
known: Vec<(NodeId, Value)>What was produced on the client that this plan reads and does not produce.
keys: Vec<(NodeId, Keys)>What each of those is called, so what runs here can name what it produces and the chain of keys does not stop at the wire.
placement: PlacementWhere each node of this slice runs.
memory: MemoryWhat is remembered about the nodes of this slice: what implements each, which are settled, which are worth keeping.
Implementations§
Source§impl Request
impl Request
Sourcepub fn to_bytes(&self) -> Result<Vec<u8>, MessageError>
pub fn to_bytes(&self) -> Result<Vec<u8>, MessageError>
This message in bytes. Fails if some value cannot leave this process.
Sourcepub fn from_bytes(bytes: &[u8]) -> Result<Self, MessageError>
pub fn from_bytes(bytes: &[u8]) -> Result<Self, MessageError>
And back from them.