pub struct ShowCommandController { /* private fields */ }Expand description
Presentation layer controller for show command workflow
Displays environment information with state-aware details. This is a read-only command that shows stored data without remote verification.
§Responsibilities
- Validate environment name format
- Delegate to application layer for data extraction
- Display state-aware information to the user
- Provide next-step guidance based on current state
§Architecture
This controller implements the Presentation Layer pattern, handling user interaction while delegating business logic to the application layer.
Implementations§
Source§impl ShowCommandController
impl ShowCommandController
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 ShowCommandController with dependencies
§Arguments
repository- Environment repository for loading environment datauser_output- Shared output service for user feedback
Sourcepub fn execute(
&mut self,
environment_name: &str,
output_format: OutputFormat,
) -> Result<(), ShowSubcommandError>
pub fn execute( &mut self, environment_name: &str, output_format: OutputFormat, ) -> Result<(), ShowSubcommandError>
Execute the show command workflow
This method orchestrates the three-step workflow:
- Validate environment name
- Load environment and extract info via application layer
- Display information to user
§Arguments
environment_name- Name of the environment to showoutput_format- Output format (Text or Json)
§Errors
Returns ShowSubcommandError if any step fails
Auto Trait Implementations§
impl !RefUnwindSafe for ShowCommandController
impl !Send for ShowCommandController
impl !Sync for ShowCommandController
impl !UnwindSafe for ShowCommandController
impl Freeze for ShowCommandController
impl Unpin for ShowCommandController
impl UnsafeUnpin for ShowCommandController
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