Skip to content

Enable Solver construction from borrowed design - #327

Open
leostimpfle wants to merge 1 commit into
design/solver-state-extractionfrom
design/solver-from-persistent-design
Open

Enable Solver construction from borrowed design#327
leostimpfle wants to merge 1 commit into
design/solver-state-extractionfrom
design/solver-from-persistent-design

Conversation

@leostimpfle

Copy link
Copy Markdown
Collaborator

Introduces Solver::from_design to construct a solver from a persistent, borrowed &'a Design<'a>.

To keep the diff minimal, I have not removed the existing Solver::new construction which takes ownership of a Design. This is facilitated by a (somewhat hacky) enum that distinguishes the existing owned construction from the new borrowed one:

enum SolverDesignStorage<'a> {
Owned(Design<'a>),
Borrowed(&'a Design<'a>),
}

In case we end up liking the separation of Design and SolverState, we may want to get rid of it. (This will create a large diff because every call-site using Solver::new will have to be updated).

@leostimpfle
leostimpfle force-pushed the design/solver-from-persistent-design branch from 4c20407 to a8398a6 Compare August 29, 2026 08:22
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.

1 participant