-
Notifications
You must be signed in to change notification settings - Fork 18
feat: introduce fetch crate #475
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
Merged
Changes from all commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
0f5c219
feat: introduce fetch crate
martintmk 40eb842
add license headers
martintmk b6307f0
fix(fetch): enable coverage_attribute feature and allow CDLA-Permissi…
martintmk 196d1ef
improve docs
martintmk a572c1d
docs and example fixes
martintmk 9966d59
fixes
martintmk f4f1dad
tests
martintmk ba7f979
new tests
martintmk 2675c9e
fixes
martintmk d7f7958
new tests
martintmk 2af2663
fixes
martintmk f3a0e2b
Merge remote-tracking branch 'origin/main' into fetch
martintmk c6f5580
improve docs
martintmk 8570fe4
Update client_builder.rs
martintmk 9bff4b5
Potential fix for pull request finding
martintmk 04ef957
Potential fix for pull request finding
martintmk e01934f
Potential fix for pull request finding
martintmk f892cdb
Potential fix for pull request finding
martintmk f79b128
Update logging.rs
martintmk File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| # fetch crate | ||
|
|
||
| ## Conditional Compilation | ||
|
|
||
| **A TLS backend is mandatory to create an `HttpClient` for real network use.** | ||
| The `tokio` runtime alone is not enough — the hyper transport layer is built on top of | ||
| TLS, so both must be enabled together. There are currently two TLS backends, `rustls` | ||
| and `native-tls`, and more may be added. This produces the recurring cfg-guard pattern: | ||
|
|
||
| ```rust | ||
| // "compile when the tokio runtime is selected AND a TLS backend is enabled" | ||
| #[cfg(all(feature = "tokio", any(feature = "rustls", feature = "native-tls")))] | ||
| ``` | ||
|
|
||
| When adding a new TLS backend, extend the inner `any(...)` accordingly (e.g. add the new | ||
| feature alongside `rustls` and `native-tls`). | ||
|
|
||
| Some items are guarded by a single TLS backend plus `test`, for example the TLS error | ||
| label resolution: | ||
|
|
||
| ```rust | ||
| #[cfg(any(feature = "rustls", test))] | ||
| // ... | ||
| #[cfg(any(feature = "native-tls", test))] | ||
| ``` | ||
|
|
||
| `test-util` is the only escape hatch: it enables `FakeHandler` (canned responses, no | ||
| network), so no TLS backend is needed. |
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.