#[non_exhaustive]pub struct NormalizedConfig {
pub config: GenerationConfig,
pub time_budget_ms: Option<u64>,
pub iteration_budget: Option<u32>,
}Expand description
归一化后的配置
经过验证和归一化处理的配置,保证所有字段都是有效的。
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.config: GenerationConfig原始配置
time_budget_ms: Option<u64>时间预算(毫秒),超过后提前返回部分结果
iteration_budget: Option<u32>迭代预算,超过后提前返回部分结果
Implementations§
Source§impl NormalizedConfig
impl NormalizedConfig
Sourcepub fn config(&self) -> &GenerationConfig
pub fn config(&self) -> &GenerationConfig
获取配置引用
Sourcepub fn with_time_budget(self, ms: u64) -> Self
pub fn with_time_budget(self, ms: u64) -> Self
设置时间预算(毫秒)
Sourcepub fn with_iteration_budget(self, iterations: u32) -> Self
pub fn with_iteration_budget(self, iterations: u32) -> Self
设置迭代预算
Trait Implementations§
Source§impl Clone for NormalizedConfig
impl Clone for NormalizedConfig
Auto Trait Implementations§
impl Forget for NormalizedConfig
impl Freeze for NormalizedConfig
impl Move for NormalizedConfig
impl RefUnwindSafe for NormalizedConfig
impl Send for NormalizedConfig
impl Sync for NormalizedConfig
impl Unpin for NormalizedConfig
impl UnsafeUnpin for NormalizedConfig
impl UnwindSafe for NormalizedConfig
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