pub struct InterruptInfo {
pub id: Option<String>,
pub reason: Option<String>,
pub payload: Option<Value>,
}Expand description
Information about a run interrupt.
When a run finishes with outcome == Interrupt, this struct contains
information about why the interrupt occurred and what input is needed.
§Example
use ag_ui_core::InterruptInfo;
let info = InterruptInfo::new()
.with_id("approval-001")
.with_reason("human_approval")
.with_payload(serde_json::json!({
"action": "DELETE",
"table": "users",
"affectedRows": 42
}));Fields§
§id: Option<String>Optional identifier for tracking this interrupt across resume.
reason: Option<String>Optional reason describing why the interrupt occurred. Common values: “human_approval”, “upload_required”, “policy_hold”
payload: Option<Value>Optional payload with context for the interrupt UI. Contains arbitrary JSON data for rendering approval forms, proposals, etc.
Implementations§
Source§impl InterruptInfo
impl InterruptInfo
Sourcepub fn new() -> InterruptInfo
pub fn new() -> InterruptInfo
Creates a new empty InterruptInfo.
Sourcepub fn with_id(self, id: impl Into<String>) -> InterruptInfo
pub fn with_id(self, id: impl Into<String>) -> InterruptInfo
Sets the interrupt ID.
Sourcepub fn with_reason(self, reason: impl Into<String>) -> InterruptInfo
pub fn with_reason(self, reason: impl Into<String>) -> InterruptInfo
Sets the interrupt reason.
Sourcepub fn with_payload(self, payload: Value) -> InterruptInfo
pub fn with_payload(self, payload: Value) -> InterruptInfo
Sets the interrupt payload.
Trait Implementations§
Source§impl Clone for InterruptInfo
impl Clone for InterruptInfo
Source§fn clone(&self) -> InterruptInfo
fn clone(&self) -> InterruptInfo
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for InterruptInfo
impl Debug for InterruptInfo
Source§impl Default for InterruptInfo
impl Default for InterruptInfo
Source§fn default() -> InterruptInfo
fn default() -> InterruptInfo
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for InterruptInfo
impl<'de> Deserialize<'de> for InterruptInfo
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<InterruptInfo, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<InterruptInfo, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for InterruptInfo
impl PartialEq for InterruptInfo
Source§impl Serialize for InterruptInfo
impl Serialize for InterruptInfo
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl StructuralPartialEq for InterruptInfo
Auto Trait Implementations§
impl Freeze for InterruptInfo
impl RefUnwindSafe for InterruptInfo
impl Send for InterruptInfo
impl Sync for InterruptInfo
impl Unpin for InterruptInfo
impl UnsafeUnpin for InterruptInfo
impl UnwindSafe for InterruptInfo
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