pub struct ExecutableSuggestorCatalog { /* private fields */ }Expand description
Registry of concrete suggestor factories that Organism may instantiate.
Implementations§
Source§impl ExecutableSuggestorCatalog
impl ExecutableSuggestorCatalog
pub fn new() -> Self
Sourcepub fn register_factory<S, F>(
&mut self,
suggestor_id: impl Into<String>,
factory: F,
) -> Result<(), FormationInstantiationError>
pub fn register_factory<S, F>( &mut self, suggestor_id: impl Into<String>, factory: F, ) -> Result<(), FormationInstantiationError>
Register a factory for a compiled suggestor_id.
Sourcepub fn register_boxed_factory<F>(
&mut self,
suggestor_id: impl Into<String>,
factory: F,
) -> Result<(), FormationInstantiationError>
pub fn register_boxed_factory<F>( &mut self, suggestor_id: impl Into<String>, factory: F, ) -> Result<(), FormationInstantiationError>
Register a boxed factory for suggestors that already erase their type.
pub fn contains(&self, suggestor_id: &str) -> bool
pub fn suggestor_ids(&self) -> Vec<&str>
Sourcepub fn instantiate(
&self,
plan: &CompiledFormationPlan,
seeds: impl IntoIterator<Item = Seed>,
) -> Result<Formation, FormationInstantiationError>
pub fn instantiate( &self, plan: &CompiledFormationPlan, seeds: impl IntoIterator<Item = Seed>, ) -> Result<Formation, FormationInstantiationError>
Instantiate a compiled plan into a runnable formation, labelled
with plan.template_id.
Provider assignments remain part of the compiled plan and outcome record. Concrete provider clients should be captured by the registered factories.
Sourcepub fn instantiate_with_label(
&self,
plan: &CompiledFormationPlan,
seeds: impl IntoIterator<Item = Seed>,
label: impl Into<String>,
) -> Result<Formation, FormationInstantiationError>
pub fn instantiate_with_label( &self, plan: &CompiledFormationPlan, seeds: impl IntoIterator<Item = Seed>, label: impl Into<String>, ) -> Result<Formation, FormationInstantiationError>
Instantiate a compiled plan into a runnable formation with a caller-supplied label. Use this when running multiple candidate rosters compiled from the same template — the unique label is the join key that lets a downstream tournament distinguish scores per candidate.
Trait Implementations§
Source§impl Clone for ExecutableSuggestorCatalog
impl Clone for ExecutableSuggestorCatalog
Source§fn clone(&self) -> ExecutableSuggestorCatalog
fn clone(&self) -> ExecutableSuggestorCatalog
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 ExecutableSuggestorCatalog
impl Debug for ExecutableSuggestorCatalog
Source§impl Default for ExecutableSuggestorCatalog
impl Default for ExecutableSuggestorCatalog
Source§fn default() -> ExecutableSuggestorCatalog
fn default() -> ExecutableSuggestorCatalog
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for ExecutableSuggestorCatalog
impl !RefUnwindSafe for ExecutableSuggestorCatalog
impl Send for ExecutableSuggestorCatalog
impl Sync for ExecutableSuggestorCatalog
impl Unpin for ExecutableSuggestorCatalog
impl UnsafeUnpin for ExecutableSuggestorCatalog
impl !UnwindSafe for ExecutableSuggestorCatalog
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<C> CloneExpand for Cwhere
C: Clone,
impl<C> CloneExpand for Cwhere
C: Clone,
fn __expand_clone_method(&self, _scope: &mut Scope) -> C
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