pub struct ExitConstraints {
pub hint: Option<ExitHint>,
pub json_mode: bool,
pub schema: Option<Value>,
}Expand description
All exit-mode constraints captured at session launch.
Stored on crate::session::SessionEntry as Option<ExitConstraints>:
None means --exit was not set; Some(_) means the session is in exit
mode and the agent must terminate via zag ps kill self <result>.
The validator ExitConstraints::validate checks the submitted result
against the hint requirement (non-empty when ExitHint::Provided),
the JSON-validity requirement (when json_mode or schema is set), and
the schema (when schema is set).
Fields§
§hint: Option<ExitHint>§json_mode: bool§schema: Option<Value>Implementations§
Source§impl ExitConstraints
impl ExitConstraints
Sourcepub fn validate(&self, result: &str) -> Result<(), ExitValidationError>
pub fn validate(&self, result: &str) -> Result<(), ExitValidationError>
Validate a submitted result against these constraints. See
validate_exit_result for the underlying logic — this is a
thin wrapper.
Trait Implementations§
Source§impl Clone for ExitConstraints
impl Clone for ExitConstraints
Source§fn clone(&self) -> ExitConstraints
fn clone(&self) -> ExitConstraints
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 ExitConstraints
impl Debug for ExitConstraints
Source§impl<'de> Deserialize<'de> for ExitConstraints
impl<'de> Deserialize<'de> for ExitConstraints
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 ExitConstraints
impl PartialEq for ExitConstraints
Source§fn eq(&self, other: &ExitConstraints) -> bool
fn eq(&self, other: &ExitConstraints) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for ExitConstraints
impl Serialize for ExitConstraints
impl StructuralPartialEq for ExitConstraints
Auto Trait Implementations§
impl Freeze for ExitConstraints
impl RefUnwindSafe for ExitConstraints
impl Send for ExitConstraints
impl Sync for ExitConstraints
impl Unpin for ExitConstraints
impl UnsafeUnpin for ExitConstraints
impl UnwindSafe for ExitConstraints
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