Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make VariablesFactor non-generic #2688

Merged
merged 3 commits into from
Jul 30, 2024
Merged

Make VariablesFactor non-generic #2688

merged 3 commits into from
Jul 30, 2024

Conversation

rylev
Copy link
Collaborator

@rylev rylev commented Jul 29, 2024

Similar to #2687 but for variables.

This does change that embedders no longer need to register the supported providers before hand. Which providers are supported and which aren't is all contained within the implementation of FactorRuntimeConfigSource<VariablesFactor>.

I also moved the host implementation to its own module like many other factors already have.

@rylev rylev requested a review from lann July 29, 2024 12:53
@lann
Copy link
Collaborator

lann commented Jul 29, 2024

Which providers are supported and which aren't is all contained within the implementation of FactorRuntimeConfigSource.

Similar to #2687 (comment) I think this indicates that we need to add functionality to the factors interface.

/// The runtime configuration for the variables factor.
#[derive(Default)]
pub struct RuntimeConfig {
pub providers: Vec<Box<dyn Provider>>,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably better to hide this field behind a e.g. add_provider method.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea. I'll make this change in a follow up.

@rylev rylev merged commit bb35e84 into factors Jul 30, 2024
2 checks passed
@rylev rylev deleted the ungeneric-variables branch July 30, 2024 09:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants