#[non_exhaustive]pub struct Frame {
pub bytes: Vec<u8>,
pub kind: FrameKind,
pub seq: Option<u64>,
pub frame_type: String,
pub correlation_id: Option<String>,
}Expand description
Single stream frame appended via append_frame (RFC-012 §3.3.0).
Today’s FCALL takes the byte payload + frame_type + optional seq as
discrete ARGV; Stage 0 collects them into a named type for trait
signatures.
Round-7 follow-up (PR #145 → #146): extended with
frame_type: String (the SDK-public free-form classifier — values
like "delta", "log", "agent_step", "summary_token",
"transcribe_line", "progress" — distinct from the coarse
FrameKind enum) and correlation_id: Option<String> (the
wire-level correlation_id ARGV, surfaced at the SDK as
metadata: Option<&str>). Adding these lets
ClaimedTask::append_frame forward through the trait without
wire-parity regression.
frame_type is free-form and is what the backend writes into the
Lua-side frame_type ARGV. FrameKind remains for typed
classification at the trait surface; when callers populate only
kind, the backend falls back to a stable encoding of the enum
variant (see frame_kind_to_str in ff-backend-valkey).
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.bytes: Vec<u8>§kind: FrameKind§seq: Option<u64>Optional monotonic sequence. Set by the caller when the stream
protocol is sequence-bound; None lets the backend assign.
frame_type: StringFree-form classifier written to the Lua-side frame_type ARGV.
Empty string means “defer to FrameKind” — the backend
substitutes the enum-variant encoding.
correlation_id: Option<String>Optional correlation id (wire correlation_id ARGV). None
encodes as the empty string on the wire.
Implementations§
Source§impl Frame
impl Frame
Sourcepub fn new(bytes: Vec<u8>, kind: FrameKind) -> Self
pub fn new(bytes: Vec<u8>, kind: FrameKind) -> Self
Construct a frame. seq defaults to None (backend-assigned);
frame_type defaults to empty (backend falls back to
FrameKind encoding); correlation_id defaults to None.
Callers that need an explicit sequence use Frame::with_seq;
callers on the SDK forwarder path populate frame_type +
correlation_id via Frame::with_frame_type /
Frame::with_correlation_id.
Sourcepub fn with_seq(bytes: Vec<u8>, kind: FrameKind, seq: u64) -> Self
pub fn with_seq(bytes: Vec<u8>, kind: FrameKind, seq: u64) -> Self
Construct a frame with an explicit monotonic sequence.
Sourcepub fn with_frame_type(self, frame_type: impl Into<String>) -> Self
pub fn with_frame_type(self, frame_type: impl Into<String>) -> Self
Builder-style setter for the free-form frame_type classifier.
Sourcepub fn with_correlation_id(self, correlation_id: impl Into<String>) -> Self
pub fn with_correlation_id(self, correlation_id: impl Into<String>) -> Self
Builder-style setter for the optional correlation_id.