isahc/config/redirect.rs
1/// Describes a policy for handling server redirects.
2///
3/// The default is to not follow redirects.
4#[derive(Clone, Copy, Debug, Eq, PartialEq)]
5pub enum RedirectPolicy {
6 /// Do not apply any special treatment to redirect responses. The response
7 /// will be returned as-is and redirects will not be followed.
8 ///
9 /// This is the default policy.
10 None,
11
12 /// Follow all redirects automatically.
13 Follow,
14
15 /// Follow redirects automatically up to a maximum number of redirects.
16 Limit(u32),
17}
18
19impl Default for RedirectPolicy {
20 fn default() -> Self {
21 RedirectPolicy::None
22 }
23}