pub struct SynthesisSystem { /* private fields */ }Expand description
Synthesis system (orchestrates synthesis processes)
Implementations§
Source§impl SynthesisSystem
impl SynthesisSystem
Sourcepub fn new(hook: Arc<dyn SynthesisHook>) -> Self
pub fn new(hook: Arc<dyn SynthesisHook>) -> Self
Create a new synthesis system with hook
Sourcepub async fn start_synthesis(
&mut self,
entity_id: EntityId,
recipe_id: RecipeId,
provided_ingredients: Vec<(IngredientType, u32)>,
synthesis_state: &mut SynthesisState,
discovery_state: &mut DiscoveryState,
registry: &RecipeRegistry,
config: &SynthesisConfig,
) -> Result<SynthesisId, SynthesisError>
pub async fn start_synthesis( &mut self, entity_id: EntityId, recipe_id: RecipeId, provided_ingredients: Vec<(IngredientType, u32)>, synthesis_state: &mut SynthesisState, discovery_state: &mut DiscoveryState, registry: &RecipeRegistry, config: &SynthesisConfig, ) -> Result<SynthesisId, SynthesisError>
Start a new synthesis process
Sourcepub async fn update_syntheses(
&mut self,
synthesis_state: &mut SynthesisState,
registry: &RecipeRegistry,
config: &SynthesisConfig,
current_time: Timestamp,
)
pub async fn update_syntheses( &mut self, synthesis_state: &mut SynthesisState, registry: &RecipeRegistry, config: &SynthesisConfig, current_time: Timestamp, )
Update all active syntheses
Sourcepub async fn attempt_recipe_discovery(
&mut self,
entity_id: EntityId,
ingredients: Vec<IngredientType>,
discovery_state: &mut DiscoveryState,
registry: &RecipeRegistry,
config: &SynthesisConfig,
) -> Option<RecipeId>
pub async fn attempt_recipe_discovery( &mut self, entity_id: EntityId, ingredients: Vec<IngredientType>, discovery_state: &mut DiscoveryState, registry: &RecipeRegistry, config: &SynthesisConfig, ) -> Option<RecipeId>
Attempt recipe discovery through experimentation
Auto Trait Implementations§
impl !RefUnwindSafe for SynthesisSystem
impl !UnwindSafe for SynthesisSystem
impl Freeze for SynthesisSystem
impl Send for SynthesisSystem
impl Sync for SynthesisSystem
impl Unpin for SynthesisSystem
impl UnsafeUnpin for SynthesisSystem
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
impl<T> Component for T
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