pub struct ComponentConfig {
pub engine_config: EngineConfig,
pub device: Device,
pub component_options: HashMap<String, Value>,
pub model_sources: Option<Arc<ProductionModelSourceBundle>>,
pub prepared_model: Option<Arc<PreparedProductionModel>>,
}Expand description
Component configuration passed to factories
Fields§
§engine_config: EngineConfigFull engine configuration
device: DeviceTarget device for the component
component_options: HashMap<String, Value>Additional component-specific options
model_sources: Option<Arc<ProductionModelSourceBundle>>Immutable role-specific product sources. This is deliberately absent from serialized EngineConfig and shared by tokenizer and executor.
prepared_model: Option<Arc<PreparedProductionModel>>Prepared typed model derived from model_sources, when the composition
root has already resolved a migrated family.
Implementations§
Source§impl ComponentConfig
impl ComponentConfig
Sourcepub fn from_engine_config(config: &EngineConfig) -> Self
pub fn from_engine_config(config: &EngineConfig) -> Self
Create from engine config
pub fn from_engine_config_and_sources( config: &EngineConfig, model_sources: Option<Arc<ProductionModelSourceBundle>>, ) -> Self
pub fn from_engine_config_and_product_model( config: &EngineConfig, model_sources: Option<Arc<ProductionModelSourceBundle>>, prepared_model: Option<Arc<PreparedProductionModel>>, ) -> Self
Sourcepub fn get_option<T: DeserializeOwned>(&self, key: &str) -> Option<T>
pub fn get_option<T: DeserializeOwned>(&self, key: &str) -> Option<T>
Get an option value
Sourcepub fn get_string_option(&self, key: &str) -> Option<String>
pub fn get_string_option(&self, key: &str) -> Option<String>
Get string option
Trait Implementations§
Source§impl Clone for ComponentConfig
impl Clone for ComponentConfig
Source§fn clone(&self) -> ComponentConfig
fn clone(&self) -> ComponentConfig
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 moreAuto Trait Implementations§
impl !RefUnwindSafe for ComponentConfig
impl !UnwindSafe for ComponentConfig
impl Freeze for ComponentConfig
impl Send for ComponentConfig
impl Sync for ComponentConfig
impl Unpin for ComponentConfig
impl UnsafeUnpin for ComponentConfig
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,
impl<T> ErasedDestructor for Twhere
T: 'static,
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