pub struct TestCommandController { /* private fields */ }Expand description
Presentation layer controller for test command workflow
Coordinates user interaction, progress reporting, and input validation
while delegating business logic to the application layer’s TestCommandHandler.
§Responsibilities
- Validate environment name format
- Create and invoke the application layer
TestCommandHandler - Report progress to the user (4 steps)
- Format success/error messages with actionable guidance
§Architecture
This controller only orchestrates the workflow - all validation logic
is implemented in the TestCommandHandler at the application layer.
The TestCommandHandler.execute() method performs all infrastructure validation:
- Cloud-init completion check
- Docker installation verification
- Docker Compose installation verification
Implementations§
Source§impl TestCommandController
impl TestCommandController
Sourcepub fn new(
repository: Arc<dyn EnvironmentRepository + Send + Sync>,
user_output: Arc<ReentrantMutex<RefCell<UserOutput>>>,
) -> Self
pub fn new( repository: Arc<dyn EnvironmentRepository + Send + Sync>, user_output: Arc<ReentrantMutex<RefCell<UserOutput>>>, ) -> Self
Create a new TestCommandController with dependencies
§Arguments
working_dir- Working directory containing the data folderrepository- Environment repository with Send + Sync boundsuser_output- Shared output service for user feedback
Sourcepub async fn execute(
&mut self,
environment_name: &str,
output_format: OutputFormat,
) -> Result<(), TestSubcommandError>
pub async fn execute( &mut self, environment_name: &str, output_format: OutputFormat, ) -> Result<(), TestSubcommandError>
Execute the complete test workflow
This method orchestrates the four-step workflow:
- Validate environment name
- Create command handler
- Execute validation workflow via application layer
- Complete workflow and display success message
§Arguments
environment_name- Name of the environment to test
§Errors
Returns TestSubcommandError if any step fails
Auto Trait Implementations§
impl !RefUnwindSafe for TestCommandController
impl !Send for TestCommandController
impl !Sync for TestCommandController
impl !UnwindSafe for TestCommandController
impl Freeze for TestCommandController
impl Unpin for TestCommandController
impl UnsafeUnpin for TestCommandController
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§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