pub struct TestConfigBuilder { /* private fields */ }Expand description
Fluent builder for creating test configurations.
This builder provides a convenient way to create configurations for testing with specific settings, using method chaining for clarity.
§Examples
use subx_cli::config::TestConfigBuilder;
let config = TestConfigBuilder::new()
.with_ai_provider("openai")
.with_ai_model("gpt-4")
.with_sync_threshold(0.8)
.build_config();Implementations§
Source§impl TestConfigBuilder
impl TestConfigBuilder
Sourcepub fn with_ai_provider(self, provider: &str) -> Self
pub fn with_ai_provider(self, provider: &str) -> Self
Sourcepub fn with_ai_model(self, model: &str) -> Self
pub fn with_ai_model(self, model: &str) -> Self
Sourcepub fn with_ai_api_key(self, api_key: &str) -> Self
pub fn with_ai_api_key(self, api_key: &str) -> Self
Sourcepub fn with_ai_base_url(self, base_url: &str) -> Self
pub fn with_ai_base_url(self, base_url: &str) -> Self
Sourcepub fn with_max_sample_length(self, length: usize) -> Self
pub fn with_max_sample_length(self, length: usize) -> Self
Set the maximum sample length for AI requests.
§Arguments
length- Maximum sample length in characters
Sourcepub fn with_ai_temperature(self, temperature: f32) -> Self
pub fn with_ai_temperature(self, temperature: f32) -> Self
Sourcepub fn with_ai_retry(self, attempts: u32, delay_ms: u64) -> Self
pub fn with_ai_retry(self, attempts: u32, delay_ms: u64) -> Self
Set the AI retry parameters.
§Arguments
attempts- Number of retry attemptsdelay_ms- Delay between retries in milliseconds
Sourcepub fn with_sync_threshold(self, threshold: f32) -> Self
pub fn with_sync_threshold(self, threshold: f32) -> Self
Sourcepub fn with_max_offset(self, offset: f32) -> Self
pub fn with_max_offset(self, offset: f32) -> Self
Sourcepub fn with_audio_sample_rate(self, sample_rate: u32) -> Self
pub fn with_audio_sample_rate(self, sample_rate: u32) -> Self
Sourcepub fn with_dialogue_detection(self, enabled: bool) -> Self
pub fn with_dialogue_detection(self, enabled: bool) -> Self
Sourcepub fn with_dialogue_params(
self,
threshold: f32,
min_duration_ms: u64,
merge_gap_ms: u64,
) -> Self
pub fn with_dialogue_params( self, threshold: f32, min_duration_ms: u64, merge_gap_ms: u64, ) -> Self
Set dialogue detection parameters.
§Arguments
threshold- Detection threshold (0.0-1.0)min_duration_ms- Minimum dialogue duration in millisecondsmerge_gap_ms- Gap for merging dialogue segments in milliseconds
Sourcepub fn with_auto_detect_sample_rate(self, enabled: bool) -> Self
pub fn with_auto_detect_sample_rate(self, enabled: bool) -> Self
Enable or disable auto-detection of sample rate.
§Arguments
enabled- Whether to enable auto-detection
Sourcepub fn with_default_output_format(self, format: &str) -> Self
pub fn with_default_output_format(self, format: &str) -> Self
Sourcepub fn with_preserve_styling(self, preserve: bool) -> Self
pub fn with_preserve_styling(self, preserve: bool) -> Self
Sourcepub fn with_default_encoding(self, encoding: &str) -> Self
pub fn with_default_encoding(self, encoding: &str) -> Self
Sourcepub fn with_encoding_detection_confidence(self, confidence: f32) -> Self
pub fn with_encoding_detection_confidence(self, confidence: f32) -> Self
Set the encoding detection confidence threshold.
§Arguments
confidence- Confidence threshold (0.0-1.0)
Sourcepub fn with_backup_enabled(self, enabled: bool) -> Self
pub fn with_backup_enabled(self, enabled: bool) -> Self
Sourcepub fn with_max_concurrent_jobs(self, jobs: usize) -> Self
pub fn with_max_concurrent_jobs(self, jobs: usize) -> Self
Sourcepub fn with_task_timeout(self, timeout_seconds: u64) -> Self
pub fn with_task_timeout(self, timeout_seconds: u64) -> Self
Sourcepub fn with_progress_bar(self, enabled: bool) -> Self
pub fn with_progress_bar(self, enabled: bool) -> Self
Sourcepub fn with_worker_idle_timeout(self, timeout_seconds: u64) -> Self
pub fn with_worker_idle_timeout(self, timeout_seconds: u64) -> Self
Sourcepub fn with_task_queue_size(self, size: usize) -> Self
pub fn with_task_queue_size(self, size: usize) -> Self
Sourcepub fn with_task_priorities(self, enabled: bool) -> Self
pub fn with_task_priorities(self, enabled: bool) -> Self
Sourcepub fn with_auto_balance_workers(self, enabled: bool) -> Self
pub fn with_auto_balance_workers(self, enabled: bool) -> Self
Sourcepub fn with_queue_overflow_strategy(self, strategy: OverflowStrategy) -> Self
pub fn with_queue_overflow_strategy(self, strategy: OverflowStrategy) -> Self
Sourcepub fn build_service(self) -> TestConfigService
pub fn build_service(self) -> TestConfigService
Build a test configuration service with the configured settings.
Sourcepub fn build_config(self) -> Config
pub fn build_config(self) -> Config
Build a configuration object with the configured settings.
Sourcepub fn config_mut(&mut self) -> &mut Config
pub fn config_mut(&mut self) -> &mut Config
Get a mutable reference to the current configuration being built.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for TestConfigBuilder
impl RefUnwindSafe for TestConfigBuilder
impl Send for TestConfigBuilder
impl Sync for TestConfigBuilder
impl Unpin for TestConfigBuilder
impl UnwindSafe for TestConfigBuilder
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<F, T> IntoSample<T> for Fwhere
T: FromSample<F>,
impl<F, T> IntoSample<T> for Fwhere
T: FromSample<F>,
fn into_sample(self) -> T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.