pub struct ResponseMeta {
pub stale: bool,
pub last_good_at: Option<String>,
pub last_error: Option<String>,
pub workspace_state: Option<WorkspaceState>,
pub daemon_version: String,
}Expand description
Metadata attached to every successful response. For Phase 8a
management methods the staleness fields are always absent
(stale = false, no last_good_at, no last_error,
workspace_state = None). Phase 8b populates them from the
server-side ServeVerdict for tool-method responses.
Fields§
§stale: bool§last_good_at: Option<String>§last_error: Option<String>§workspace_state: Option<WorkspaceState>Canonical workspace state string (serde form of
WorkspaceState). None for methods not tied to a workspace.
daemon_version: StringImplementations§
Source§impl ResponseMeta
impl ResponseMeta
Sourcepub fn management(daemon_version: &str) -> Self
pub fn management(daemon_version: &str) -> Self
Construct the ResponseMeta used by daemon management methods
(daemon/status, daemon/unload, daemon/stop — the ones not
bound to a specific workspace).
Sourcepub fn loaded(daemon_version: &str) -> Self
pub fn loaded(daemon_version: &str) -> Self
Construct the ResponseMeta for a successful daemon/load.
Phase 8b adds fresh_from / stale_from constructors for
MCP tool-method responses that route through classify_for_serve.
Sourcepub fn fresh_from(state: WorkspaceState, daemon_version: &str) -> Self
pub fn fresh_from(state: WorkspaceState, daemon_version: &str) -> Self
Construct ResponseMeta for a tool-method response served from a
Fresh workspace verdict (WorkspaceState::Loaded or Rebuilding).
Phase 8b Task 7 — populated by the tool_dispatch helper when
the daemon’s WorkspaceManager::classify_for_serve returns
ServeVerdict::Fresh. stale is false and both last_good_at
and last_error are absent from the wire form (they are skipped
by serde(skip_serializing_if = "Option::is_none")).
Sourcepub fn stale_from(
last_good_at: SystemTime,
last_error: Option<String>,
daemon_version: &str,
) -> Self
pub fn stale_from( last_good_at: SystemTime, last_error: Option<String>, daemon_version: &str, ) -> Self
Construct ResponseMeta for a tool-method response served from a
Stale verdict. last_good_at is rendered as RFC3339 UTC-Zulu via
chrono::DateTime::<Utc>::from(SystemTime) -> to_rfc3339_opts(Secs, true).
workspace_state is fixed at WorkspaceState::Failed because
WorkspaceManager::classify_for_serve only emits a Stale verdict
when the observed state is Failed. Keeping this constructor
intentionally rigid (no caller-supplied state) prevents the wire
form from claiming stale = true with a workspace_state the
classifier could never have produced.
Trait Implementations§
Source§impl Clone for ResponseMeta
impl Clone for ResponseMeta
Source§fn clone(&self) -> ResponseMeta
fn clone(&self) -> ResponseMeta
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more