pub struct RenderCommandController { /* private fields */ }Expand description
Presentation layer controller for render command workflow
Coordinates user interaction, progress reporting, and input validation for generating deployment artifacts without executing deployment.
§Responsibilities
- Validate input mode (env-name OR env-file)
- Parse and validate IP address
- Show progress updates to the user
- Format output for display
- Delegate artifact generation to application layer handler
§Architecture
This controller sits in the presentation layer and handles all user-facing
concerns. Business logic is delegated to the application layer’s
RenderCommandHandler.
Implementations§
Source§impl RenderCommandController
impl RenderCommandController
Sourcepub fn new(
repository: Arc<dyn EnvironmentRepository>,
user_output: Arc<ReentrantMutex<RefCell<UserOutput>>>,
) -> Self
pub fn new( repository: Arc<dyn EnvironmentRepository>, user_output: Arc<ReentrantMutex<RefCell<UserOutput>>>, ) -> Self
Create a new render command controller
Creates a RenderCommandController with repository and user output.
This follows the single container architecture pattern.
Sourcepub async fn execute(
&mut self,
env_name: Option<&str>,
env_file: Option<&Path>,
ip: &str,
output_dir: &Path,
force: bool,
working_dir: &Path,
output_format: OutputFormat,
) -> Result<(), RenderCommandError>
pub async fn execute( &mut self, env_name: Option<&str>, env_file: Option<&Path>, ip: &str, output_dir: &Path, force: bool, working_dir: &Path, output_format: OutputFormat, ) -> Result<(), RenderCommandError>
Execute the render command workflow
This performs input validation and delegates to the application handler.
§Arguments
env_name- Optional environment name (mutually exclusive withenv_file)env_file- Optional config file path (mutually exclusive withenv_name)ip- Target instance IP address (required)output_dir- Output directory for generated artifacts (required)force- Whether to overwrite existing output directoryworking_dir- Working directory for environment data (from –working-dir global arg)output_format- Output format (text or JSON)
§Returns
Ok(())- Artifact generation succeededErr(RenderCommandError)- Validation or generation failed
§Errors
Returns an error if:
- Neither
env_namenorenv_fileis provided - IP address is invalid
- Output directory exists and force is false
- Config file doesn’t exist
- Environment not found
- Template rendering fails
Auto Trait Implementations§
impl !RefUnwindSafe for RenderCommandController
impl !Send for RenderCommandController
impl !Sync for RenderCommandController
impl !UnwindSafe for RenderCommandController
impl Freeze for RenderCommandController
impl Unpin for RenderCommandController
impl UnsafeUnpin for RenderCommandController
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