pub struct TryAlternate {
pub servers: Vec<SocketAddr>,
pub domain: Option<String>,
}Expand description
The redirection of an authenticated 300 (Try Alternate): see
ErrorResponse::try_alternate and Client::follow_alternate.
What a 300 (Try Alternate) error response says.
Fields§
§servers: Vec<SocketAddr>The ALTERNATE-SERVER attributes, in the order the server sent them: the first has the address family the request was sent to, a second one, if any, the other family.
domain: Option<String>ALTERNATE-DOMAIN: the name the alternate server’s certificate is checked against when
the transport is TLS or DTLS. None: the domain of the original request applies.
Implementations§
Source§impl TryAlternate
impl TryAlternate
Sourcepub fn from_response(
response: &ValidatedMessage,
) -> Result<Option<TryAlternate>, Error>
pub fn from_response( response: &ValidatedMessage, ) -> Result<Option<TryAlternate>, Error>
Reads the redirection out of response.
Ok(None) when the response is not a 300 error response, when it has no
ALTERNATE-SERVER, or when it is not authenticated: RFC 8489 section 14.8 lets a client
follow a 300 only after validating its integrity attribute (a forged one would point
the client’s requests, credentials included, at a victim), and a
ValidatedMessage shows only the attributes that integrity covers. The transaction
has failed in each of those cases, as with any other error response.
§Errors
Fails when an ALTERNATE-SERVER or the ALTERNATE-DOMAIN is malformed.
Sourcepub fn server_for(&self, original: IpAddr) -> Option<SocketAddr>
pub fn server_for(&self, original: IpAddr) -> Option<SocketAddr>
The alternate server of the address family of original, the server the request was
sent to; the first alternate of any family when there is none. Only an alternate that
is_usable_alternate is taken: None when the response names no other.
Sourcepub fn server_attributes(&self) -> Vec<AlternateServer>
pub fn server_attributes(&self) -> Vec<AlternateServer>
The ALTERNATE-SERVER attributes of this redirection, for a server (or a test) that builds the 300 response.
Trait Implementations§
Source§impl Clone for TryAlternate
impl Clone for TryAlternate
Source§fn clone(&self) -> TryAlternate
fn clone(&self) -> TryAlternate
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more