Repository navigation
Introduce builders for the storage implementations - #260
Draft
Alnusjaponica wants to merge 1 commit into
Draft
Alnusjaponica wants to merge 1 commit into
Alnusjaponica wants to merge 1 commit into
Conversation
Alnusjaponica
marked this pull request as draft
September 28, 2026 02:21
Member
|
@Alnusjaponica Is this PR ready for review? |
Alnusjaponica
marked this pull request as ready for review
November 4, 2026 10:06
Alnusjaponica
marked this pull request as draft
November 6, 2026 05:33
Alnusjaponica
force-pushed
the
feat/storage-builder
branch
2 times, most recently
from
November 19, 2026 02:38
c8b38d5 to
b8bebf7
Compare
Alnusjaponica
force-pushed
the
feat/storage-builder
branch
from
November 19, 2026 08:30
b8bebf7 to
a710f54
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Replace the
XxxStorageOptions/new_with_option(s)construction pattern with builders following the API style ofstd::thread::Builder: settings are configured by chaining setter methods and the storage is created withbuild. As withthread::Builder::new(),XxxBuilder::new()is the only entry point (consistent withPedAnovaBuilderin #262).Changes
InMemoryStorageBuilder(withDefault),SQLite3StorageBuilder, andJournalStorageBuilder, exposingnew(), chainable setters (apply_discard,attr_format), andbuild()InMemoryStorageOptions,SQLite3StorageOptions,JournalStorageOptionsandnew_with_option/new_with_optionsnewonInMemoryStorage/SQLite3Storage/JournalStoragewith the existing signatures; it now delegates to the buildersToRustStorage's cache) to construct storages through the builderscache.rsthat referenced the removed options structsVerification
cargo test --locked --all-features— all pass (including new doctests)cargo test --locked -- --ignored(fromrustuna_storage, with Optuna installed) — 6 passcargo clippy --locked --workspace --lib --bins --tests --examples --all-features -- -D warnings— cleancargo fmt --all -- --check— cleanuv run --no-sync pytest tests/— 706 passed, 16 skipped🤖 Generated with Claude Code