Closed jcamiel closed 1 year ago
The bindings are manually curated and not comprehensive. We've generally only added bindings to curl-sys
as needed (particularly when the safe curl
crate decides to expose them) as the full libcurl API surface is very large. The skips just (usually) indicate that we have not defined constants for several valid libcurl flags.
We do accept contributions though to add bindings to things currently not exposed. The full list of version flags at least in the latest curl version can be found here.
Some version flags just haven't made too much sense to expose though because they aren't directly supported by this crate (take Brotli for example: https://github.com/alexcrichton/curl-rust/issues/458) and so it isn't currently possible to enable the feature unless you link to an existing libcurl build with that feature enabled.
I've the impression that the bindings have been written for a version of curl that have not yet defined this fields
Since we do support being dynamically linked to a system-wide version of libcurl which could be an unknown version, we do try to be very careful on bindings to ensure that the curl
crate will work against a variety of libcurl versions. However, adding new flags is generally safe since old versions of libcurl will simply return an error for unrecognized flags; it is actual new symbols where more care must be taken.
@sagebind Thank you for you detailed explanation.
If I understand you correctly, can I propose a PR to add feature_https_proxy
as a new method to ask for CURL_VERSION_HTTPS_PROXY
?
Another question, I was wondering, would be possible to expose the raw features version bitfield (instead of adding more "semantic" features" like feature_foot
impl Version {
....
fn features(&self) -> i32 {
}
...
}
I can propose also another PR, if it is, of course, aligned with the curl_crate
design / feature set.
Fixed by #468.
Hi,
First of all, as a developer of Hurl, a big thanks for this crate. Our modest project could not exist without
curl-rust
. I try to mimic the output ofcurl --version
(in https://github.com/Orange-OpenSource/hurl/issues/836) and would like to display the features supported by thelibcurl
used byhurl
.With curl for instance, we can have this output:
My issue is with the line
With the apis in
curl_rust
I can construct a list of some features:But I don't see the way to get the information if, for instance, the features
HTTPS-proxy
is supported. There is nofeature_https_proxy()
method, nor raw access to the bitfields.In lib.rs, I don't see the definition for
CURL_VERSION_HTTPS_PROXY
and I struggle to understand the "gap" in bit mask.Some other field are also absent, like
CURL_VERSION_THREADSAFE
for instance.My issue shows for sure my poor comprehension of the build of
curl-rust
. I've the impression that the bindings have been written for a version of curl that have not yet defined this fields so I don't see any way to know if newer features are supported or not in a more recent libcurl.Sorry for my not very clear issue!