pub struct SuccessEnvelope<T> {
pub version: u32,
pub result: T,
pub refusal: bool,
}Expand description
The --json success envelope for a prompt run: { version, result, refusal }. result holds a QueryResult; refusal is true when the
response looked like a refusal, so a consumer can branch on
“got an answer” vs “got refused” without parsing the body.
Generic over the payload so the producer serializes with T = &QueryResult
(no clone) and a consumer deserializes SuccessEnvelope<QueryResult>.
Fields§
§version: u32ABI version (VERSION).
result: TThe run’s result payload.
refusal: boolTrue when the response looked like a refusal.
Implementations§
Trait Implementations§
Source§impl<T: Clone> Clone for SuccessEnvelope<T>
impl<T: Clone> Clone for SuccessEnvelope<T>
Source§fn clone(&self) -> SuccessEnvelope<T>
fn clone(&self) -> SuccessEnvelope<T>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<T: Debug> Debug for SuccessEnvelope<T>
impl<T: Debug> Debug for SuccessEnvelope<T>
Source§impl<'de, T> Deserialize<'de> for SuccessEnvelope<T>where
T: Deserialize<'de>,
impl<'de, T> Deserialize<'de> for SuccessEnvelope<T>where
T: Deserialize<'de>,
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl<T> Freeze for SuccessEnvelope<T>where
T: Freeze,
impl<T> RefUnwindSafe for SuccessEnvelope<T>where
T: RefUnwindSafe,
impl<T> Send for SuccessEnvelope<T>where
T: Send,
impl<T> Sync for SuccessEnvelope<T>where
T: Sync,
impl<T> Unpin for SuccessEnvelope<T>where
T: Unpin,
impl<T> UnsafeUnpin for SuccessEnvelope<T>where
T: UnsafeUnpin,
impl<T> UnwindSafe for SuccessEnvelope<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