diff --git a/crates/stackable-operator/src/config/fragment.rs b/crates/stackable-operator/src/config/fragment.rs index a1a89f6be..22142e833 100644 --- a/crates/stackable-operator/src/config/fragment.rs +++ b/crates/stackable-operator/src/config/fragment.rs @@ -19,6 +19,19 @@ use super::merge::Merge; #[cfg(doc)] use crate::role_utils::{Role, RoleGroup}; +/// Turns a invalidated struct into the validated counterpart the build step works with. +#[allow(dead_code)] +pub trait IntoValidated { + /// `Validated` counterpart of the struct to validate. + type Validated; + /// Error thrown when failed to validate a `Config`. + type Error; + + /// Consumes and validates self and returns [`Self::Validated`] or [`Self::Error`] if + /// validation failed. + fn validate(self) -> Result; +} + /// Contains context used for generating validation errors /// /// Constructed internally in [`validate`]