#[non_exhaustive]pub enum Redirect {
Follow,
SameHost,
Ignore,
}Expand description
What to do with the URI a peer names in its GOAWAY.
The URI is dialed exactly as given, so it must carry whatever credentials the new endpoint needs. Nothing from the current session is copied onto it.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Follow
Follow any URI that does not downgrade the scheme, letting the peer name the host as well as the port.
The host is dialed as written, so this hands the peer whatever this process can reach: a name it controls can carry an A record for loopback, a private range, or the metadata service, and nothing here resolves it to find out. A literal loopback, private, link-local, or IPC target is still refused, but that catches a misconfigured peer, not a hostile one. Use it only with an upstream trusted with the local network and with the tokens every session presents.
SameHost
Follow only when the host matches the dialed URL, so a peer can move us between ports or schemes but not to another host. The default.
Ignore
Ignore the URI and redial the current targets.
Trait Implementations§
impl Copy for Redirect
impl Eq for Redirect
impl StructuralPartialEq for Redirect
Auto Trait Implementations§
impl Freeze for Redirect
impl RefUnwindSafe for Redirect
impl Send for Redirect
impl Sync for Redirect
impl Unpin for Redirect
impl UnsafeUnpin for Redirect
impl UnwindSafe for Redirect
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.