pub struct RenderCaddyTemplatesStep<S> { /* private fields */ }Expand description
Step that renders Caddy templates to the build directory
This step handles the preparation of Caddy configuration files by rendering templates to the build directory. The rendered files are then ready to be deployed to the remote host.
Caddy is only rendered when:
- HTTPS configuration is present in the environment
- At least one service has TLS configured
Implementations§
Source§impl<S> RenderCaddyTemplatesStep<S>
impl<S> RenderCaddyTemplatesStep<S>
Sourcepub fn new(
environment: Arc<Environment<S>>,
templates_dir: PathBuf,
build_dir: PathBuf,
clock: Arc<dyn Clock>,
) -> Self
pub fn new( environment: Arc<Environment<S>>, templates_dir: PathBuf, build_dir: PathBuf, clock: Arc<dyn Clock>, ) -> Self
Creates a new RenderCaddyTemplatesStep
§Arguments
environment- The deployment environmenttemplates_dir- The templates directorybuild_dir- The build directory where templates will be renderedclock- Clock service for generating timestamps
Sourcepub fn execute(
&self,
) -> Result<Option<PathBuf>, CaddyTemplateRenderingServiceError>
pub fn execute( &self, ) -> Result<Option<PathBuf>, CaddyTemplateRenderingServiceError>
Execute the template rendering step
This will render Caddy templates to the build directory if HTTPS configuration is present in the environment and at least one service has TLS configured.
§Returns
Returns the path to the Caddy build directory on success, or None
if HTTPS/TLS is not configured.
§Errors
Returns an error if:
- Template rendering fails
- Directory creation fails
- File writing fails
Auto Trait Implementations§
impl<S> !RefUnwindSafe for RenderCaddyTemplatesStep<S>
impl<S> !UnwindSafe for RenderCaddyTemplatesStep<S>
impl<S> Freeze for RenderCaddyTemplatesStep<S>
impl<S> Send for RenderCaddyTemplatesStep<S>
impl<S> Sync for RenderCaddyTemplatesStep<S>
impl<S> Unpin for RenderCaddyTemplatesStep<S>
impl<S> UnsafeUnpin for RenderCaddyTemplatesStep<S>
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