pub struct ShimmedPayload { /* private fields */ }Expand description
One translated invocation: the legacy payload to send, plus what is needed to map a modified legacy payload back onto the original message.
Implementations§
Source§impl ShimmedPayload
impl ShimmedPayload
Sourcepub fn legacy_hook(&self) -> &'static str
pub fn legacy_hook(&self) -> &'static str
The legacy hook name to send as the task’s hook_type.
Sourcepub fn payload(&self) -> &Value
pub fn payload(&self) -> &Value
The legacy payload JSON, in the shape the worker’s json_to_payload
rebuilds into the matching Pydantic model.
Sourcepub fn apply_modified(
&self,
modified: Value,
) -> Result<MessagePayload, HostError>
pub fn apply_modified( &self, modified: Value, ) -> Result<MessagePayload, HostError>
Map a worker’s modified legacy payload back onto the original message.
Only the fields the legacy payload carries are written. A modification the message has nowhere to hold (tool headers, resource metadata, a prompt result description, a resource blob) fails closed: dropping it would silently undo what the plugin asked for.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ShimmedPayload
impl RefUnwindSafe for ShimmedPayload
impl Send for ShimmedPayload
impl Sync for ShimmedPayload
impl Unpin for ShimmedPayload
impl UnsafeUnpin for ShimmedPayload
impl UnwindSafe for ShimmedPayload
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