pub struct Response<T>where
T: Serialize + JsonSchema,{
pub status: ResponseStatus,
pub result: Option<T>,
pub runtime_error: Option<RuntimeFailure>,
pub freshness: FreshnessIdentity,
pub telemetry: Option<Telemetry>,
pub warnings: Vec<String>,
pub next_actions: Vec<String>,
pub trust_artifacts: Vec<ArtifactTrust>,
/* private fields */
}Fields§
§status: ResponseStatus§result: Option<T>§runtime_error: Option<RuntimeFailure>§freshness: FreshnessIdentity§telemetry: Option<Telemetry>§warnings: Vec<String>§next_actions: Vec<String>§trust_artifacts: Vec<ArtifactTrust>Typed artifact-freshness facts for the semantic trust block. These are not telemetry; quiet-mode serialization must keep them.
Implementations§
Source§impl<T> Response<T>where
T: Serialize + JsonSchema,
impl<T> Response<T>where
T: Serialize + JsonSchema,
pub fn ok(result: T, freshness: Freshness) -> Self
pub fn result_ref(&self) -> Option<&T>
Sourcepub fn runtime(&self) -> Option<&RuntimeFacts>
pub fn runtime(&self) -> Option<&RuntimeFacts>
The worker runtime facts, read from the telemetry block. None once the
boundary gate has dropped telemetry (quiet verbosity) or before any
runtime was attached.
Sourcepub fn imports(&self) -> &[String]
pub fn imports(&self) -> &[String]
The caller-supplied import set, read from the telemetry block. Used by internal tool composition before the semantic boundary gate runs.
pub fn with_runtime(self, runtime: RuntimeFacts) -> Self
Sourcepub fn drop_telemetry(&mut self)
pub fn drop_telemetry(&mut self)
Drop the telemetry block — the default quiet verbosity gate, applied at
the serialization boundary. Identity, result, warnings,
next_actions, and runtime_error are untouched, so no correctness or
truncation signal is lost.
pub fn with_trust_artifact(self, artifact: ArtifactTrust) -> Self
pub fn with_trust_artifacts( self, artifacts: impl IntoIterator<Item = ArtifactTrust>, ) -> Self
pub fn warn(self, msg: impl Into<String>) -> Self
pub fn hint(self, msg: impl Into<String>) -> Self
Trait Implementations§
Source§impl<T> JsonSchema for Response<T>
impl<T> JsonSchema for Response<T>
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Returns a string that uniquely identifies the schema produced by this type. Read more
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
Whether JSON Schemas generated for this type should be included directly in parent schemas,
rather than being re-used where possible using the
$ref keyword. Read moreAuto Trait Implementations§
impl<T> Freeze for Response<T>where
T: Freeze,
impl<T> RefUnwindSafe for Response<T>where
T: RefUnwindSafe,
impl<T> Send for Response<T>where
T: Send,
impl<T> Sync for Response<T>where
T: Sync,
impl<T> Unpin for Response<T>where
T: Unpin,
impl<T> UnsafeUnpin for Response<T>where
T: UnsafeUnpin,
impl<T> UnwindSafe for Response<T>where
T: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more