pub struct EffectRequest {
pub id: String,
pub kind: EffectKind,
pub description: String,
pub payload: Value,
pub source: EffectSource,
pub risk: RiskLevel,
pub timeout: Option<Duration>,
pub metadata: RunMetadata,
}Expand description
Request for an outer harness to govern and execute a side effect.
Fields§
§id: StringEffect id, unique within the process or harness session.
kind: EffectKindEffect kind.
description: StringUser-visible approval/audit description.
payload: ValueKind-specific JSON payload.
source: EffectSourceSource tool-call metadata, when produced by a tool.
risk: RiskLevelRequest-declared risk.
timeout: Option<Duration>Request-level timeout suggestion.
metadata: RunMetadataHost/application metadata.
Implementations§
Source§impl EffectRequest
impl EffectRequest
Sourcepub fn new(
kind: EffectKind,
description: impl Into<String>,
payload: Value,
) -> Self
pub fn new( kind: EffectKind, description: impl Into<String>, payload: Value, ) -> Self
Constructs an effect request with a generated id.
Sourcepub fn with_source(
self,
tool_call_id: impl Into<String>,
tool_name: impl Into<String>,
) -> Self
pub fn with_source( self, tool_call_id: impl Into<String>, tool_name: impl Into<String>, ) -> Self
Sets the source tool-call metadata.
Sourcepub fn with_source_if_missing(
self,
tool_call_id: impl Into<String>,
tool_name: impl Into<String>,
) -> Self
pub fn with_source_if_missing( self, tool_call_id: impl Into<String>, tool_name: impl Into<String>, ) -> Self
Fills missing source fields without overwriting fields already set by the tool.
Sourcepub fn with_timeout(self, timeout: Duration) -> Self
pub fn with_timeout(self, timeout: Duration) -> Self
Sets the request-level timeout suggestion.
Sourcepub fn with_metadata(self, metadata: RunMetadata) -> Self
pub fn with_metadata(self, metadata: RunMetadata) -> Self
Sets host/application metadata.
Trait Implementations§
Source§impl Clone for EffectRequest
impl Clone for EffectRequest
Source§fn clone(&self) -> EffectRequest
fn clone(&self) -> EffectRequest
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 Debug for EffectRequest
impl Debug for EffectRequest
Source§impl<'de> Deserialize<'de> for EffectRequest
impl<'de> Deserialize<'de> for EffectRequest
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
Source§impl PartialEq for EffectRequest
impl PartialEq for EffectRequest
Source§impl Serialize for EffectRequest
impl Serialize for EffectRequest
impl StructuralPartialEq for EffectRequest
Auto Trait Implementations§
impl Freeze for EffectRequest
impl RefUnwindSafe for EffectRequest
impl Send for EffectRequest
impl Sync for EffectRequest
impl Unpin for EffectRequest
impl UnsafeUnpin for EffectRequest
impl UnwindSafe for EffectRequest
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