enum RedirectBehavior [src]

Any value other than not_allowed or unhandled means that integer represents how many remaining redirects are allowed.

Fields

not_allowed = 0The next redirect will cause an error.
unhandled = std.math.maxInt(u16)Redirects are passed to the client to analyze the redirect response directly.
_

Members

Source

pub const RedirectBehavior = enum(u16) { /// The next redirect will cause an error. not_allowed = 0, /// Redirects are passed to the client to analyze the redirect response /// directly. unhandled = std.math.maxInt(u16), _, pub fn subtractOne(rb: *RedirectBehavior) void { switch (rb.*) { .not_allowed => unreachable, .unhandled => unreachable, _ => rb.* = @enumFromInt(@intFromEnum(rb.*) - 1), } } pub fn remaining(rb: RedirectBehavior) u16 { assert(rb != .unhandled); return @intFromEnum(rb); } }