pub enum HumanInputOutcome {
Provided(Value),
Rejected {
reason: String,
},
}Expand description
Answer applied to a human input step by a StepInterceptor.
§Examples
use ironflow_engine::executor::HumanInputOutcome;
use serde_json::json;
let answered = HumanInputOutcome::Provided(json!({"answers": ["yes"]}));
let refused = HumanInputOutcome::reject("out of scope");
assert_ne!(answered, refused);Variants§
Provided(Value)
The input is answered with this value; it must match the expected type.
Rejected
The input is refused; the handler receives
EngineError::HumanInputRejected.
Implementations§
Source§impl HumanInputOutcome
impl HumanInputOutcome
Sourcepub fn reject(reason: &str) -> Self
pub fn reject(reason: &str) -> Self
Build a HumanInputOutcome::Rejected with the given reason.
§Examples
use ironflow_engine::executor::HumanInputOutcome;
let outcome = HumanInputOutcome::reject("out of scope");
assert_eq!(
outcome,
HumanInputOutcome::Rejected { reason: "out of scope".to_string() }
);Trait Implementations§
Source§impl Clone for HumanInputOutcome
impl Clone for HumanInputOutcome
Source§impl Debug for HumanInputOutcome
impl Debug for HumanInputOutcome
Source§impl PartialEq for HumanInputOutcome
impl PartialEq for HumanInputOutcome
impl StructuralPartialEq for HumanInputOutcome
Auto Trait Implementations§
impl Freeze for HumanInputOutcome
impl RefUnwindSafe for HumanInputOutcome
impl Send for HumanInputOutcome
impl Sync for HumanInputOutcome
impl Unpin for HumanInputOutcome
impl UnsafeUnpin for HumanInputOutcome
impl UnwindSafe for HumanInputOutcome
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