pub struct ExecuteContext<W>where
W: Write,{
pub log: W,
pub pb: ProgressBar,
pub status_dir: Arc<TempDir>,
pub id: Option<String>,
pub status_file: Option<PathBuf>,
pub log_file: Option<PathBuf>,
}
Expand description
A context used in task execution
Fields§
§log: W
Global log file object. (aka. risedev.log)
pb: ProgressBar
Progress bar on screen.
status_dir: Arc<TempDir>
The directory for checking status.
RiseDev
will instruct every task to output their status to a file in temporary folder. By
checking this file, we can know whether a task has early exited.
id: Option<String>
The current service id running in this context.
status_file: Option<PathBuf>
The status file corresponding to the current context.
log_file: Option<PathBuf>
The log file corresponding to the current context. (e.g. frontend-4566.log)
Implementations§
Source§impl<W> ExecuteContext<W>where
W: Write,
impl<W> ExecuteContext<W>where
W: Write,
fn wait_log_contains(&mut self, patterns: &[String]) -> Result<()>
Source§impl<W> ExecuteContext<W>where
W: Write,
impl<W> ExecuteContext<W>where
W: Write,
pub fn new(log: W, pb: ProgressBar, status_dir: Arc<TempDir>) -> Self
pub fn service(&mut self, task: &impl Task)
pub fn run_command(&mut self, cmd: Command) -> Result<Output>
pub fn complete_spin(&mut self)
pub fn status_path(&self) -> PathBuf
pub fn log_path(&self) -> &Path
pub fn wait_tcp(&mut self, server: impl AsRef<str>) -> Result<()>
fn wait_http_with_response_cb( &mut self, server: impl AsRef<str>, cb: impl Fn(Response) -> Result<()>, ) -> Result<()>
pub fn wait_http(&mut self, server: impl AsRef<str>) -> Result<()>
pub fn wait_http_with_text_cb( &mut self, server: impl AsRef<str>, cb: impl Fn(&str) -> bool, ) -> Result<()>
pub fn wait(&mut self, wait_func: impl FnMut() -> Result<()>) -> Result<()>
Sourcepub fn wait_tcp_close(&mut self, server: impl AsRef<str>) -> Result<()>
pub fn wait_tcp_close(&mut self, server: impl AsRef<str>) -> Result<()>
Wait for a TCP port to close
Sourcepub fn wait_tcp_user(&mut self, server: impl AsRef<str>) -> Result<()>
pub fn wait_tcp_user(&mut self, server: impl AsRef<str>) -> Result<()>
Wait for a user-managed service to be available
pub fn tmux_run(&self, user_cmd: Command) -> Result<Command>
Auto Trait Implementations§
impl<W> Freeze for ExecuteContext<W>where
W: Freeze,
impl<W> RefUnwindSafe for ExecuteContext<W>where
W: RefUnwindSafe,
impl<W> Send for ExecuteContext<W>where
W: Send,
impl<W> Sync for ExecuteContext<W>where
W: Sync,
impl<W> Unpin for ExecuteContext<W>where
W: Unpin,
impl<W> UnwindSafe for ExecuteContext<W>where
W: UnwindSafe,
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T
in a tonic::Request