pub struct Script { /* private fields */ }Expand description
A sequence of stdout/stderr events and delays that ScriptedShell replays
through the spinner overlay renderer.
Build one with the fluent builder methods (Script::out, Script::err,
Script::delay_ms, etc.) and enqueue it on a ScriptedShell via
ScriptedShell::push.
Intended for testing use.
Implementations§
Source§impl Script
impl Script
Sourcepub fn out_ms(self, text: &str, ms: u64) -> Self
pub fn out_ms(self, text: &str, ms: u64) -> Self
Write raw text to stdout then sleep for ms milliseconds.
Sourcepub fn out_line_ms(self, text: &str, ms: u64) -> Self
pub fn out_line_ms(self, text: &str, ms: u64) -> Self
Write text followed by a newline to stdout then sleep for ms milliseconds.
Sourcepub fn out_cr_ms(self, text: &str, ms: u64) -> Self
pub fn out_cr_ms(self, text: &str, ms: u64) -> Self
Write text followed by a cr to stdout then sleep for ms milliseconds.
Sourcepub fn err_ms(self, text: &str, ms: u64) -> Self
pub fn err_ms(self, text: &str, ms: u64) -> Self
Write raw text to stderr then sleep for ms milliseconds.
Sourcepub fn err_line_ms(self, text: &str, ms: u64) -> Self
pub fn err_line_ms(self, text: &str, ms: u64) -> Self
Write text followed by a newline to stderr then sleep for ms milliseconds.
Sourcepub fn delay_ms(self, ms: u64) -> Self
pub fn delay_ms(self, ms: u64) -> Self
Sleep for ms milliseconds before processing the next event.
Sourcepub fn exit_failure(self) -> Self
pub fn exit_failure(self) -> Self
Mark this script as exiting with a failure code. Default is success.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Script
impl RefUnwindSafe for Script
impl Send for Script
impl Sync for Script
impl Unpin for Script
impl UnsafeUnpin for Script
impl UnwindSafe for Script
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