Struct isahc::config::VersionNegotiation [−][src]
A strategy for selecting what HTTP versions should be used when communicating with a server.
You can set a version negotiation strategy on a given request or on a client
with Configurable::version_negotiation
.
Attempting to use an HTTP version without client-side support at runtime
will result in an error. For example, using the system libcurl on an old
machine may not have an HTTP/2 implementation. Using static linking and the
http2
crate feature can help guarantee that HTTP/2
will be available to use.
Implementations
impl VersionNegotiation
[src]
pub const fn latest_compatible() -> Self
[src]
Always prefer the latest supported version announced by the server, falling back to older versions if not explicitly listed as supported. This is the default.
Secure connections will begin with a TLS handshake, after which the
highest supported HTTP version listed by the server via ALPN will be
used. Once connected, additional upgrades to newer versions may also
occur if the server lists support for it. In the future, headers such as
Alt-Svc
will be used.
Insecure connections always use HTTP/1.x since there is no standard mechanism for a server to declare support for insecure HTTP versions, and only HTTP/1.x and HTTP/2 support insecure transfers.
pub const fn http10() -> Self
[src]
Connect via HTTP/1.0 and do not attempt to use a higher version.
pub const fn http11() -> Self
[src]
Connect via HTTP/1.1 and do not attempt to use a higher version.
pub const fn http2() -> Self
[src]
Connect via HTTP/2. Failure to connect will not fall back to old versions, unless HTTP/1.1 is negotiated via TLS ALPN before the session begins.
If HTTP/2 support is not compiled in, then using this strategy will always result in an error.
This strategy is often referred to as HTTP/2 with Prior Knowledge.
pub const fn http3() -> Self
[src]
Connect via HTTP/3. Failure to connect will not fall back to old versions.
Trait Implementations
impl Clone for VersionNegotiation
[src]
fn clone(&self) -> VersionNegotiation
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for VersionNegotiation
[src]
impl Default for VersionNegotiation
[src]
Auto Trait Implementations
impl RefUnwindSafe for VersionNegotiation
[src]
impl Send for VersionNegotiation
[src]
impl Sync for VersionNegotiation
[src]
impl Unpin for VersionNegotiation
[src]
impl UnwindSafe for VersionNegotiation
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T> Instrument for T
[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T> Instrument for T
[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> WithSubscriber for T
[src]
pub fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
[src]
S: Into<Dispatch>,