Refactors public API for 1.0 readiness#23
Merged
Conversation
Re-export leaked foreign types, #[non_exhaustive] + builder for ConnectOptions and #[non_exhaustive] Error, and tidy the mocking surface (export WebSocketStreamType, move backpressure_probe_server into the test suite). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…mType These foreign types already appeared in the public API (send_raw, RawCodec, Error, ConnectOptions, HandshakeContext, get_mock_address) but were not re-exported, forcing downstream version-matched direct deps. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Replace public-field construction with ConnectOptions::builder() and make the struct non_exhaustive so future options are additive. Fields become pub(crate); internal reads are unchanged. BREAKING CHANGE: ConnectOptions fields are no longer public; construct via ConnectOptions::builder() or ::default(). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Allows new error variants to be added without a breaking change; downstream matches must now include a wildcard arm. BREAKING CHANGE: Error is now non_exhaustive. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
It is a socketeer-specific test fixture, not a general-purpose mock; it only reached the public API via the crate root. It now lives in tests/support and drives the public get_mock_address/WebSocketStreamType entry point. BREAKING CHANGE: backpressure_probe_server is no longer re-exported. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…en test - Re-export `ConnectOptionsBuilder` from `src/lib.rs` so downstream code can name the builder type (Fix 1) - Reword `ConnectOptionsBuilder::header` doc to reflect `insert` (replace) semantics rather than append (Fix 2) - Add `[package.metadata.docs.rs] all-features = true` to Cargo.toml so the `get_mock_address` intra-doc link resolves on docs.rs; extend `WebSocketStreamType` doc note to mention `mocking` feature (Fix 3) - Strengthen `headers_replaces_whole_map` test: seed a prior header, call `.headers()`, assert the seeded header is gone (Fix 4) Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #23 +/- ##
==========================================
+ Coverage 94.64% 94.86% +0.21%
==========================================
Files 7 7
Lines 635 662 +27
==========================================
+ Hits 601 628 +27
Misses 34 34 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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.
This release introduces significant breaking changes to
socketeer's public API, aiming to tighten its surface, improve maintainability, and future-proof for 1.0.Key Changes
socketeer::access toMessage,Bytes,httpmodule,tungstenitemodule (includingError), andWebSocketStreamType. This removes the need for downstream users to manage direct dependencies on these crates.ConnectOptionsbuilder: Replaces public fields with a builder pattern (ConnectOptions::builder()...build()) and marks the struct#[non_exhaustive]. This allows for future expansion of connection options without breaking changes.Errorenum is#[non_exhaustive]: Ensures new error variants can be added without forcing downstreammatchstatements to update.backpressure_probe_servertest fixture out of the public API into internal test helpers, while makingWebSocketStreamTypepublicly available for custom mock server implementations.docs.rsto build documentation with all features.What it Solves
bytes,http, andtokio-tungstenitefor types already exposed bysocketeer.ConnectOptionsandErrorto evolve with additive changes without introducing further breaking changes in their public interface.mockingfeature by removing a specific test utility from its public surface and clarifying the entry point for custom mock servers.This aligns with the pre-1.0 public API cleanup strategy defined in the associated design and implementation plan.