StaticnewCreates a new successful response with the specified request ID.
By default, the result will be the 'OK' known value. Use withResult
to set a specific result value.
StaticnewCreates a new failure response with the specified request ID.
By default, the error will be the 'Unknown' known value. Use
withError to set a specific error message.
StaticnewCreates a new early failure response without a request ID.
An early failure occurs when the error happens before the request has been fully processed, so the request ID is not known.
StaticunknownCreates an envelope containing the 'Unknown' known value.
StaticokCreates an envelope containing the 'OK' known value.
Returns a human-readable summary of the response.
Sets the result value for a successful response.
Sets the error value for a failure response.
Returns true if this is a successful response.
Returns true if this is a failure response.
Returns the ID of the request this response corresponds to, if known.
Returns the result envelope if this is a successful response.
Returns the error envelope if this is a failure response.
Converts the response to an envelope.
Successful responses have the request ID as the subject and a 'result' assertion. Failure responses have the request ID (or 'Unknown' if not known) as the subject and an 'error' assertion.
StaticfromReturns a string representation of the response.
A Response represents a reply to a Request containing either a successful result or an error.
Example