-
Notifications
You must be signed in to change notification settings - Fork 40
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
Custom backends support #405
base: master
Are you sure you want to change the base?
Commits on Sep 27, 2019
-
In http::sender::params, use http crate instead of reqwest
The types in reqwest are re-exports of the types in http, so this should not break anything, and is needed to make reqwests an optional dependency.
Configuration menu - View commit details
-
Copy full SHA for a962397 - Browse repository at this point
Copy the full SHA a962397View commit details
Commits on Oct 3, 2019
-
Refactor into common Pending type
Almost every module in client::requests defines their own Pending struct, wrapping a Boxed future, using copy+pasted code. This patch implements a templated Pending type in the client::requests module, and uses it in submodules. The patch also sets up a type alias called Pending in each of the submodules, to retain backwards compatibility.
Configuration menu - View commit details
-
Copy full SHA for fae77d4 - Browse repository at this point
Copy the full SHA fae77d4View commit details
Commits on Oct 4, 2019
-
Move the implementations of NextParams for SniffedNodes into the sender's corresponding files, since they fit better there. Remove (a)sync_next, since it couples the SniffedNodes object too tightly to the senders. Instead, senders can call `next_or_start_refresh` on the SniffedNodes object to get the address or a new `Refresher` struct indicating that a refresh is needed. The sender can then send out the request for the node list, and when the sender gets the results, it can feed them to the Refresher, consuming it. This makes the SniffedNodes object flexible with how senders receive their results.
Configuration menu - View commit details
-
Copy full SHA for 3cc17ad - Browse repository at this point
Copy the full SHA 3cc17adView commit details
Commits on Nov 8, 2019
-
Add RequestInner trait, and implement it on request types
The trait specifies the Request and Response types of the request, and specifies a function to convert the request builder to the Request type. All of the request builder types already had an `into_request` function, so this trait just codifies that behavior. Note that the raw request does not implement this (yet) since it does not do a standard conversion. This patch doesn't have any uses of the trait yet, but future patches will make use of it.
Configuration menu - View commit details
-
Copy full SHA for c2384f7 - Browse repository at this point
Copy the full SHA c2384f7View commit details -
Generate IntoEndpoint for request types
The request types can only be converted into one concrete type of Endpoint, but the existing From trait implementation can't convey that, making it impossible to write a bound for a type that can be converted into an endpoint with any body type. The new IntoEndpoint trait fixes this by making the body an associated type. The bound can be written as, for instance, `Req: for<'a> IntoEndpoint<'a>`
Configuration menu - View commit details
-
Copy full SHA for dc6dcc0 - Browse repository at this point
Copy the full SHA dc6dcc0View commit details -
This adds and changes things to allow external implementations of `Sender` to exist, and to have a unified send function for results (currently implemented alongside of the existing send functionality, but will replace it). This patch adds TypedSender<T>, a companion trait for Sender that also lets the client handle deserialization, instead of having every request type implement deserialization for the two available senders.
Configuration menu - View commit details
-
Copy full SHA for a173049 - Browse repository at this point
Copy the full SHA a173049View commit details -
Configuration menu - View commit details
-
Copy full SHA for ec49293 - Browse repository at this point
Copy the full SHA ec49293View commit details -
Configuration menu - View commit details
-
Copy full SHA for d94d864 - Browse repository at this point
Copy the full SHA d94d864View commit details -
Features for SyncSender and AsyncSender
Client code can now choose whether to include the sync sender or async sender via Cargo's features system. By default both are included. Make public some crate-private types, a) to avoid unused warnings, and b) other crates will likely need them for custom sender implementations. Had to downgrade the url crate to be compatible with reqwest's version.
Configuration menu - View commit details
-
Copy full SHA for c610228 - Browse repository at this point
Copy the full SHA c610228View commit details -
Configuration menu - View commit details
-
Copy full SHA for 59e5cbc - Browse repository at this point
Copy the full SHA 59e5cbcView commit details -
Make HttpRequest fields public
Custom backends need access to the fields
Configuration menu - View commit details
-
Copy full SHA for 063edc0 - Browse repository at this point
Copy the full SHA 063edc0View commit details -
Create a public constructor for Client
Allows custom backends to create a client
Configuration menu - View commit details
-
Copy full SHA for 68444ed - Browse repository at this point
Copy the full SHA 68444edView commit details -
Remove NextParams, moving functionality to Sender::next_params
The trait requires implementing on types that this crate exports, like SniffedNodes<TSender> and its parent NodeAddresses<TSender>, but that's not possible to do in external crates, due to rust's orphan rules. The return type, once again, is heavily dependent on the sender, since SniffedNodes needs to do a potentially asynchronous http request. So just cut out the middle man and fold the code into the Sender trait.
Configuration menu - View commit details
-
Copy full SHA for 6250ac2 - Browse repository at this point
Copy the full SHA 6250ac2View commit details -
Backends in other crates will want to use that function.
Configuration menu - View commit details
-
Copy full SHA for f0ddf2e - Browse repository at this point
Copy the full SHA f0ddf2eView commit details -
Remove sender from SniffedNodes
It's not needed anymore, now that the Sender itself is responsible for querying for nodes.
Configuration menu - View commit details
-
Copy full SHA for 354f265 - Browse repository at this point
Copy the full SHA 354f265View commit details -
Configuration menu - View commit details
-
Copy full SHA for 72aa708 - Browse repository at this point
Copy the full SHA 72aa708View commit details
Commits on Nov 15, 2019
-
Configuration menu - View commit details
-
Copy full SHA for 34cacea - Browse repository at this point
Copy the full SHA 34caceaView commit details