pub enum PtyStep {
Send {
text: String,
},
Expect {
pattern: String,
regex: bool,
timeout_ms: Option<u64>,
},
}Expand description
One step of a PtyScript, serde-tagged on op:
{"op":"send","text":"…"} / {"op":"expect","pattern":"…",…}.
Variants§
Send
Write text to the pty verbatim — JSON string escapes carry the
control bytes (\n submits a line to a canonical-mode REPL, \r
for raw-mode TUIs, \u001b for escape sequences), so no separate
key-name vocabulary is needed.
Expect
Block until the accumulated session output contains pattern
(a literal substring; a regular expression when regex is true)
or the step’s timeout elapses. A timeout — or the target exiting
unmatched — FAILS the assertion at this step.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for PtyStep
impl<'de> Deserialize<'de> for PtyStep
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
Auto Trait Implementations§
impl Freeze for PtyStep
impl RefUnwindSafe for PtyStep
impl Send for PtyStep
impl Sync for PtyStep
impl Unpin for PtyStep
impl UnsafeUnpin for PtyStep
impl UnwindSafe for PtyStep
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