pub struct BattalionConfig {
pub name: String,
pub description: Option<String>,
pub timeout_seconds: u64,
pub retry_policy: RetryPolicy,
pub error_strategy: ErrorStrategy,
pub metadata_output_dir: Option<PathBuf>,
}Expand description
Configuration for Battalion operations
§Examples
use paladin_core::platform::container::battalion::{BattalionConfig, ErrorStrategy};
let config = BattalionConfig::new("research_battalion")
.with_timeout(300)
.with_error_strategy(ErrorStrategy::FailFast);Fields§
§name: StringName of the Battalion
description: Option<String>Optional description
timeout_seconds: u64Maximum execution time in seconds
retry_policy: RetryPolicyRetry policy for failed operations
error_strategy: ErrorStrategyStrategy for handling errors
metadata_output_dir: Option<PathBuf>Directory for saving metadata output
Implementations§
Source§impl BattalionConfig
impl BattalionConfig
Sourcepub fn new(name: impl Into<String>) -> BattalionConfig
pub fn new(name: impl Into<String>) -> BattalionConfig
Create a new BattalionConfig with the given name.
§Arguments
name- Name identifier for this Battalion
Uses default values for all other configuration options.
Sourcepub fn with_description(self, description: impl Into<String>) -> BattalionConfig
pub fn with_description(self, description: impl Into<String>) -> BattalionConfig
Set the description (builder pattern).
§Arguments
description- Human-readable description of the Battalion’s purpose
Sourcepub fn with_timeout(self, seconds: u64) -> BattalionConfig
pub fn with_timeout(self, seconds: u64) -> BattalionConfig
Set the timeout in seconds (builder pattern).
§Arguments
seconds- Maximum execution time before timing out
Sourcepub fn with_retry_policy(self, policy: RetryPolicy) -> BattalionConfig
pub fn with_retry_policy(self, policy: RetryPolicy) -> BattalionConfig
Set the retry policy
Sourcepub fn with_error_strategy(self, strategy: ErrorStrategy) -> BattalionConfig
pub fn with_error_strategy(self, strategy: ErrorStrategy) -> BattalionConfig
Set the error strategy
Sourcepub fn with_metadata_dir(self, dir: PathBuf) -> BattalionConfig
pub fn with_metadata_dir(self, dir: PathBuf) -> BattalionConfig
Set the metadata output directory
Sourcepub fn validate_metadata_dir(&self) -> Result<(), String>
pub fn validate_metadata_dir(&self) -> Result<(), String>
Validate the metadata output directory, if configured
Checks that the directory exists and is writable. If metadata_output_dir
is None, validation passes trivially.
§Returns
Ok(())if the directory is valid or not configuredErr(String)with a description of the validation failure
Trait Implementations§
Source§impl Clone for BattalionConfig
impl Clone for BattalionConfig
Source§fn clone(&self) -> BattalionConfig
fn clone(&self) -> BattalionConfig
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for BattalionConfig
impl Debug for BattalionConfig
Source§impl Default for BattalionConfig
impl Default for BattalionConfig
Source§fn default() -> BattalionConfig
fn default() -> BattalionConfig
Creates a BattalionConfig with default values.
§Default Values
name: “default_battalion”timeout_seconds: 300 (5 minutes)retry_policy: RetryPolicy::default()error_strategy: ErrorStrategy::FailFast
Source§impl<'de> Deserialize<'de> for BattalionConfig
impl<'de> Deserialize<'de> for BattalionConfig
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<BattalionConfig, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<BattalionConfig, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Serialize for BattalionConfig
impl Serialize for BattalionConfig
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
Auto Trait Implementations§
impl Freeze for BattalionConfig
impl RefUnwindSafe for BattalionConfig
impl Send for BattalionConfig
impl Sync for BattalionConfig
impl Unpin for BattalionConfig
impl UnsafeUnpin for BattalionConfig
impl UnwindSafe for BattalionConfig
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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 more