Struct PredictorRegistry
pub struct PredictorRegistry { /* private fields */ }Expand description
Explicit registry mapping custom predictor names to runtime factories.
Implementations§
§impl PredictorRegistry
impl PredictorRegistry
pub fn new() -> PredictorRegistry
pub fn new() -> PredictorRegistry
Create an empty registry.
pub fn register_model<F>(&mut self, name: impl Into<String>, factory: F)
pub fn register_model<F>(&mut self, name: impl Into<String>, factory: F)
Register a runtime custom model factory.
pub fn register_model_checked<F>(
&mut self,
name: impl Into<String>,
factory: F,
trace: &str,
spec: &FieldSchema,
field: &FieldInfo,
) -> Result<(), ConformanceError>
pub fn register_model_checked<F>( &mut self, name: impl Into<String>, factory: F, trace: &str, spec: &FieldSchema, field: &FieldInfo, ) -> Result<(), ConformanceError>
Register a runtime model and run conformance check on a sample predictor.
pub fn build(
&self,
name: &str,
spec: &FieldSchema,
field: &FieldInfo,
) -> Result<Box<dyn Predictor>, ConfigError>
pub fn build( &self, name: &str, spec: &FieldSchema, field: &FieldInfo, ) -> Result<Box<dyn Predictor>, ConfigError>
Build a predictor by registered custom name.
Trait Implementations§
§impl Debug for PredictorRegistry
impl Debug for PredictorRegistry
§impl Default for PredictorRegistry
impl Default for PredictorRegistry
§fn default() -> PredictorRegistry
fn default() -> PredictorRegistry
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl !RefUnwindSafe for PredictorRegistry
impl !UnwindSafe for PredictorRegistry
impl Freeze for PredictorRegistry
impl Send for PredictorRegistry
impl Sync for PredictorRegistry
impl Unpin for PredictorRegistry
impl UnsafeUnpin for PredictorRegistry
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