an http based roguelike rpg about jelqing
Blame: src/game/state.rs
782069860236 | atagen | 2026-10-10 12:44 UTC | 1 | use axum::http::StatusCode; |
782069860236 | atagen | 2026-10-10 12:44 UTC | 2 | |
782069860236 | atagen | 2026-10-10 12:44 UTC | 3 | use crate::problem::Problem; |
782069860236 | atagen | 2026-10-10 12:44 UTC | 4 | |
782069860236 | atagen | 2026-10-10 12:44 UTC | 5 | #[derive(Clone, Copy, PartialEq, Eq, Debug)] |
782069860236 | atagen | 2026-10-10 12:44 UTC | 6 | #[repr(u8)] |
782069860236 | atagen | 2026-10-10 12:44 UTC | 7 | pub enum Floor { |
782069860236 | atagen | 2026-10-10 12:44 UTC | 8 | Bedroom = 1, |
782069860236 | atagen | 2026-10-10 12:44 UTC | 9 | Bathroom = 2, |
9683736a2c5e | atagen | 2026-10-10 13:15 UTC | 10 | ChangingRoom = 3, |
9683736a2c5e | atagen | 2026-10-10 13:15 UTC | 11 | Nans = 4, |
782069860236 | atagen | 2026-10-10 12:44 UTC | 12 | Hotel = 5, |
782069860236 | atagen | 2026-10-10 12:44 UTC | 13 | Forum = 6, |
782069860236 | atagen | 2026-10-10 12:44 UTC | 14 | Clinic = 7, |
782069860236 | atagen | 2026-10-10 12:44 UTC | 15 | } |
782069860236 | atagen | 2026-10-10 12:44 UTC | 16 | |
782069860236 | atagen | 2026-10-10 12:44 UTC | 17 | impl Floor { |
782069860236 | atagen | 2026-10-10 12:44 UTC | 18 | pub fn number(self) -> u8 { |
782069860236 | atagen | 2026-10-10 12:44 UTC | 19 | self as u8 |
782069860236 | atagen | 2026-10-10 12:44 UTC | 20 | } |
782069860236 | atagen | 2026-10-10 12:44 UTC | 21 | |
782069860236 | atagen | 2026-10-10 12:44 UTC | 22 | pub fn next(self) -> Option<Self> { |
782069860236 | atagen | 2026-10-10 12:44 UTC | 23 | match self { |
782069860236 | atagen | 2026-10-10 12:44 UTC | 24 | Self::Bedroom => Some(Self::Bathroom), |
9683736a2c5e | atagen | 2026-10-10 13:15 UTC | 25 | Self::Bathroom => Some(Self::ChangingRoom), |
9683736a2c5e | atagen | 2026-10-10 13:15 UTC | 26 | Self::ChangingRoom => Some(Self::Nans), |
9683736a2c5e | atagen | 2026-10-10 13:15 UTC | 27 | Self::Nans => Some(Self::Hotel), |
782069860236 | atagen | 2026-10-10 12:44 UTC | 28 | Self::Hotel => Some(Self::Forum), |
782069860236 | atagen | 2026-10-10 12:44 UTC | 29 | Self::Forum => Some(Self::Clinic), |
782069860236 | atagen | 2026-10-10 12:44 UTC | 30 | Self::Clinic => None, |
782069860236 | atagen | 2026-10-10 12:44 UTC | 31 | } |
782069860236 | atagen | 2026-10-10 12:44 UTC | 32 | } |
782069860236 | atagen | 2026-10-10 12:44 UTC | 33 | |
782069860236 | atagen | 2026-10-10 12:44 UTC | 34 | pub fn name(self) -> &'static str { |
782069860236 | atagen | 2026-10-10 12:44 UTC | 35 | match self { |
782069860236 | atagen | 2026-10-10 12:44 UTC | 36 | Self::Bedroom => "the bedroom", |
782069860236 | atagen | 2026-10-10 12:44 UTC | 37 | Self::Bathroom => "the shared bathroom", |
9683736a2c5e | atagen | 2026-10-10 13:15 UTC | 38 | Self::ChangingRoom => "the gym changing room", |
9683736a2c5e | atagen | 2026-10-10 13:15 UTC | 39 | Self::Nans => "Nan's house at Christmas", |
782069860236 | atagen | 2026-10-10 12:44 UTC | 40 | Self::Hotel => "a business trip hotel", |
782069860236 | atagen | 2026-10-10 12:44 UTC | 41 | Self::Forum => "the forum", |
782069860236 | atagen | 2026-10-10 12:44 UTC | 42 | Self::Clinic => "the urologist's office", |
782069860236 | atagen | 2026-10-10 12:44 UTC | 43 | } |
782069860236 | atagen | 2026-10-10 12:44 UTC | 44 | } |
782069860236 | atagen | 2026-10-10 12:44 UTC | 45 | |
782069860236 | atagen | 2026-10-10 12:44 UTC | 46 | pub fn note(self) -> &'static str { |
782069860236 | atagen | 2026-10-10 12:44 UTC | 47 | match self { |
782069860236 | atagen | 2026-10-10 12:44 UTC | 48 | Self::Bedroom => "The door does not lock. The cat is present.", |
7d3fb63208bf | atagen | 2026-10-11 04:38 UTC | 49 | Self::Bathroom => "The water is hot. Your brother showers at eight.", |
9683736a2c5e | atagen | 2026-10-10 13:15 UTC | 50 | Self::ChangingRoom => { |
782069860236 | atagen | 2026-10-10 12:44 UTC | 51 | "It is cold. Discretion is advised. Everyone here is lying. Pump-Bro is by the lockers." |
782069860236 | atagen | 2026-10-10 12:44 UTC | 52 | } |
9683736a2c5e | atagen | 2026-10-10 13:15 UTC | 53 | Self::Nans => { |
9683736a2c5e | atagen | 2026-10-10 13:15 UTC | 54 | "The walls are thin. Mum is here, and she has been reading about Digest authentication." |
782069860236 | atagen | 2026-10-10 12:44 UTC | 55 | } |
782069860236 | atagen | 2026-10-10 12:44 UTC | 56 | Self::Hotel => { |
782069860236 | atagen | 2026-10-10 12:44 UTC | 57 | "The wifi requires agreement. Housekeeping does not knock. Pump-Bro is in the lobby." |
782069860236 | atagen | 2026-10-10 12:44 UTC | 58 | } |
782069860236 | atagen | 2026-10-10 12:44 UTC | 59 | Self::Forum => "Nothing physical happens here. The Elder has a spreadsheet.", |
782069860236 | atagen | 2026-10-10 12:44 UTC | 60 | Self::Clinic => "The urologist will see you now. He is bored.", |
782069860236 | atagen | 2026-10-10 12:44 UTC | 61 | } |
782069860236 | atagen | 2026-10-10 12:44 UTC | 62 | } |
782069860236 | atagen | 2026-10-10 12:44 UTC | 63 | |
782069860236 | atagen | 2026-10-10 12:44 UTC | 64 | pub fn observer(self) -> Option<Observer> { |
782069860236 | atagen | 2026-10-10 12:44 UTC | 65 | match self { |
782069860236 | atagen | 2026-10-10 12:44 UTC | 66 | Self::Bedroom => Some(Observer::Cat), |
9683736a2c5e | atagen | 2026-10-10 13:15 UTC | 67 | Self::ChangingRoom => Some(Observer::Greg), |
9683736a2c5e | atagen | 2026-10-10 13:15 UTC | 68 | Self::Nans => Some(Observer::Nan), |
782069860236 | atagen | 2026-10-10 12:44 UTC | 69 | _ => None, |
782069860236 | atagen | 2026-10-10 12:44 UTC | 70 | } |
782069860236 | atagen | 2026-10-10 12:44 UTC | 71 | } |
782069860236 | atagen | 2026-10-10 12:44 UTC | 72 | |
9683736a2c5e | atagen | 2026-10-10 13:15 UTC | 73 | pub fn has_mum(self) -> bool { |
9683736a2c5e | atagen | 2026-10-10 13:15 UTC | 74 | matches!(self, Self::Bedroom | Self::Nans) |
782069860236 | atagen | 2026-10-10 12:44 UTC | 75 | } |
782069860236 | atagen | 2026-10-10 12:44 UTC | 76 | |
782069860236 | atagen | 2026-10-10 12:44 UTC | 77 | pub fn has_window(self) -> bool { |
9683736a2c5e | atagen | 2026-10-10 13:15 UTC | 78 | matches!(self, Self::Bedroom | Self::Nans | Self::Hotel) |
782069860236 | atagen | 2026-10-10 12:44 UTC | 79 | } |
782069860236 | atagen | 2026-10-10 12:44 UTC | 80 | |
782069860236 | atagen | 2026-10-10 12:44 UTC | 81 | pub fn shop_open(self) -> bool { |
9683736a2c5e | atagen | 2026-10-10 13:15 UTC | 82 | matches!(self, Self::ChangingRoom | Self::Hotel) |
782069860236 | atagen | 2026-10-10 12:44 UTC | 83 | } |
782069860236 | atagen | 2026-10-10 12:44 UTC | 84 | |
0a0bfee8329e | atagen | 2026-10-11 05:11 UTC | 85 | pub fn has_kitchen(self) -> bool { |
0a0bfee8329e | atagen | 2026-10-11 05:11 UTC | 86 | matches!(self, Self::Bedroom | Self::Nans) |
0a0bfee8329e | atagen | 2026-10-11 05:11 UTC | 87 | } |
0a0bfee8329e | atagen | 2026-10-11 05:11 UTC | 88 | |
782069860236 | atagen | 2026-10-10 12:44 UTC | 89 | pub fn timed(self) -> bool { |
782069860236 | atagen | 2026-10-10 12:44 UTC | 90 | !matches!(self, Self::Forum | Self::Clinic) |
782069860236 | atagen | 2026-10-10 12:44 UTC | 91 | } |
782069860236 | atagen | 2026-10-10 12:44 UTC | 92 | } |
782069860236 | atagen | 2026-10-10 12:44 UTC | 93 | |
782069860236 | atagen | 2026-10-10 12:44 UTC | 94 | #[derive(Clone, Copy, PartialEq, Eq, Debug)] |
782069860236 | atagen | 2026-10-10 12:44 UTC | 95 | pub enum Observer { |
782069860236 | atagen | 2026-10-10 12:44 UTC | 96 | Cat, |
782069860236 | atagen | 2026-10-10 12:44 UTC | 97 | Greg, |
9683736a2c5e | atagen | 2026-10-10 13:15 UTC | 98 | Nan, |
782069860236 | atagen | 2026-10-10 12:44 UTC | 99 | } |
782069860236 | atagen | 2026-10-10 12:44 UTC | 100 | |
782069860236 | atagen | 2026-10-10 12:44 UTC | 101 | impl Observer { |
782069860236 | atagen | 2026-10-10 12:44 UTC | 102 | pub fn name(self) -> &'static str { |
782069860236 | atagen | 2026-10-10 12:44 UTC | 103 | match self { |
782069860236 | atagen | 2026-10-10 12:44 UTC | 104 | Self::Cat => "cat", |
782069860236 | atagen | 2026-10-10 12:44 UTC | 105 | Self::Greg => "greg", |
9683736a2c5e | atagen | 2026-10-10 13:15 UTC | 106 | Self::Nan => "nan", |
782069860236 | atagen | 2026-10-10 12:44 UTC | 107 | } |
782069860236 | atagen | 2026-10-10 12:44 UTC | 108 | } |
782069860236 | atagen | 2026-10-10 12:44 UTC | 109 | } |
782069860236 | atagen | 2026-10-10 12:44 UTC | 110 | |
782069860236 | atagen | 2026-10-10 12:44 UTC | 111 | #[derive(Clone, Copy, PartialEq, Eq, Debug)] |
782069860236 | atagen | 2026-10-10 12:44 UTC | 112 | pub enum Grip { |
782069860236 | atagen | 2026-10-10 12:44 UTC | 113 | Overhand, |
782069860236 | atagen | 2026-10-10 12:44 UTC | 114 | Underhand, |
782069860236 | atagen | 2026-10-10 12:44 UTC | 115 | } |
782069860236 | atagen | 2026-10-10 12:44 UTC | 116 | |
782069860236 | atagen | 2026-10-10 12:44 UTC | 117 | impl Grip { |
782069860236 | atagen | 2026-10-10 12:44 UTC | 118 | pub fn name(self) -> &'static str { |
782069860236 | atagen | 2026-10-10 12:44 UTC | 119 | match self { |
782069860236 | atagen | 2026-10-10 12:44 UTC | 120 | Self::Overhand => "overhand", |
782069860236 | atagen | 2026-10-10 12:44 UTC | 121 | Self::Underhand => "underhand", |
782069860236 | atagen | 2026-10-10 12:44 UTC | 122 | } |
782069860236 | atagen | 2026-10-10 12:44 UTC | 123 | } |
782069860236 | atagen | 2026-10-10 12:44 UTC | 124 | |
782069860236 | atagen | 2026-10-10 12:44 UTC | 125 | pub fn parse(protocol: &str) -> Option<Self> { |
782069860236 | atagen | 2026-10-10 12:44 UTC | 126 | match protocol.to_ascii_lowercase().as_str() { |
782069860236 | atagen | 2026-10-10 12:44 UTC | 127 | "overhand" => Some(Self::Overhand), |
782069860236 | atagen | 2026-10-10 12:44 UTC | 128 | "underhand" => Some(Self::Underhand), |
782069860236 | atagen | 2026-10-10 12:44 UTC | 129 | _ => None, |
782069860236 | atagen | 2026-10-10 12:44 UTC | 130 | } |
782069860236 | atagen | 2026-10-10 12:44 UTC | 131 | } |
782069860236 | atagen | 2026-10-10 12:44 UTC | 132 | } |
782069860236 | atagen | 2026-10-10 12:44 UTC | 133 | |
782069860236 | atagen | 2026-10-10 12:44 UTC | 134 | /// State that belongs to the current floor and resets when you leave it. |
782069860236 | atagen | 2026-10-10 12:44 UTC | 135 | #[derive(Default)] |
782069860236 | atagen | 2026-10-10 12:44 UTC | 136 | pub struct FloorState { |
782069860236 | atagen | 2026-10-10 12:44 UTC | 137 | pub turns: u32, |
e807266c323b | atagen | 2026-10-12 09:46 UTC | 138 | pub drawer_searched: bool, |
782069860236 | atagen | 2026-10-10 12:44 UTC | 139 | pub edges: u8, |
782069860236 | atagen | 2026-10-10 12:44 UTC | 140 | pub temp_length: f64, |
782069860236 | atagen | 2026-10-10 12:44 UTC | 141 | pub teapot: bool, |
782069860236 | atagen | 2026-10-10 12:44 UTC | 142 | pub towel_stolen: bool, |
7d3fb63208bf | atagen | 2026-10-11 04:38 UTC | 143 | pub brother_told: bool, |
7d3fb63208bf | atagen | 2026-10-11 04:38 UTC | 144 | pub shopping: bool, |
0fdc47364c8c | atagen | 2026-10-11 04:45 UTC | 145 | pub meditated: bool, |
0a0bfee8329e | atagen | 2026-10-11 05:11 UTC | 146 | pub melon_offered: bool, |
4347977b8192 | atagen | 2026-10-11 04:56 UTC | 147 | pub warm_arrival: bool, |
782069860236 | atagen | 2026-10-10 12:44 UTC | 148 | pub wifi_accepted: bool, |
782069860236 | atagen | 2026-10-10 12:44 UTC | 149 | } |
782069860236 | atagen | 2026-10-10 12:44 UTC | 150 | |
782069860236 | atagen | 2026-10-10 12:44 UTC | 151 | #[derive(Default)] |
782069860236 | atagen | 2026-10-10 12:44 UTC | 152 | pub struct Conditions { |
782069860236 | atagen | 2026-10-10 12:44 UTC | 153 | pub peyronie: bool, |
782069860236 | atagen | 2026-10-10 12:44 UTC | 154 | pub pulled_muscle: bool, |
782069860236 | atagen | 2026-10-10 12:44 UTC | 155 | pub priapism_turns: u8, |
5dfebcc0ac43 | atagen | 2026-10-11 05:28 UTC | 156 | pub friction_burn: bool, |
782069860236 | atagen | 2026-10-10 12:44 UTC | 157 | } |
782069860236 | atagen | 2026-10-10 12:44 UTC | 158 | |
9683736a2c5e | atagen | 2026-10-10 13:15 UTC | 159 | pub struct MumVisit { |
782069860236 | atagen | 2026-10-10 12:44 UTC | 160 | pub errand: &'static str, |
782069860236 | atagen | 2026-10-10 12:44 UTC | 161 | pub nonce: String, |
782069860236 | atagen | 2026-10-10 12:44 UTC | 162 | pub strikes: u8, |
0d604ee39751 | atagen | 2026-10-10 14:15 UTC | 163 | pub knocked: bool, |
782069860236 | atagen | 2026-10-10 12:44 UTC | 164 | } |
782069860236 | atagen | 2026-10-10 12:44 UTC | 165 | |
782069860236 | atagen | 2026-10-10 12:44 UTC | 166 | #[derive(Clone, Copy, PartialEq, Eq, Debug)] |
782069860236 | atagen | 2026-10-10 12:44 UTC | 167 | pub enum Elder { |
782069860236 | atagen | 2026-10-10 12:44 UTC | 168 | Unverified { strikes: u8 }, |
782069860236 | atagen | 2026-10-10 12:44 UTC | 169 | Verified, |
782069860236 | atagen | 2026-10-10 12:44 UTC | 170 | Beaten, |
782069860236 | atagen | 2026-10-10 12:44 UTC | 171 | } |
782069860236 | atagen | 2026-10-10 12:44 UTC | 172 | |
782069860236 | atagen | 2026-10-10 12:44 UTC | 173 | #[derive(Default)] |
782069860236 | atagen | 2026-10-10 12:44 UTC | 174 | pub struct Clinic { |
782069860236 | atagen | 2026-10-10 12:44 UTC | 175 | pub intake_attempts: usize, |
782069860236 | atagen | 2026-10-10 12:44 UTC | 176 | pub measured: bool, |
782069860236 | atagen | 2026-10-10 12:44 UTC | 177 | pub cured: bool, |
782069860236 | atagen | 2026-10-10 12:44 UTC | 178 | } |
782069860236 | atagen | 2026-10-10 12:44 UTC | 179 | |
782069860236 | atagen | 2026-10-10 12:44 UTC | 180 | #[derive(Clone, Copy, PartialEq, Eq, Debug)] |
782069860236 | atagen | 2026-10-10 12:44 UTC | 181 | pub enum Story { |
782069860236 | atagen | 2026-10-10 12:44 UTC | 182 | Unopened, |
782069860236 | atagen | 2026-10-10 12:44 UTC | 183 | Pending, |
782069860236 | atagen | 2026-10-10 12:44 UTC | 184 | ReadForum, |
782069860236 | atagen | 2026-10-10 12:44 UTC | 185 | ClosedTab, |
782069860236 | atagen | 2026-10-10 12:44 UTC | 186 | } |
782069860236 | atagen | 2026-10-10 12:44 UTC | 187 | |
782069860236 | atagen | 2026-10-10 12:44 UTC | 188 | #[derive(Clone, Copy, PartialEq, Eq, Debug)] |
782069860236 | atagen | 2026-10-10 12:44 UTC | 189 | pub enum Cause { |
782069860236 | atagen | 2026-10-10 12:44 UTC | 190 | Ruptured { ice_unused: bool }, |
782069860236 | atagen | 2026-10-10 12:44 UTC | 191 | Caught, |
0d604ee39751 | atagen | 2026-10-10 14:15 UTC | 192 | Opened, |
782069860236 | atagen | 2026-10-10 12:44 UTC | 193 | Banned, |
782069860236 | atagen | 2026-10-10 12:44 UTC | 194 | Degloved, |
9683736a2c5e | atagen | 2026-10-10 13:15 UTC | 195 | Zip, |
0a0bfee8329e | atagen | 2026-10-11 05:11 UTC | 196 | Meloned, |
782069860236 | atagen | 2026-10-10 12:44 UTC | 197 | Abandoned, |
782069860236 | atagen | 2026-10-10 12:44 UTC | 198 | } |
782069860236 | atagen | 2026-10-10 12:44 UTC | 199 | |
782069860236 | atagen | 2026-10-10 12:44 UTC | 200 | impl Cause { |
782069860236 | atagen | 2026-10-10 12:44 UTC | 201 | pub fn slug(self) -> &'static str { |
782069860236 | atagen | 2026-10-10 12:44 UTC | 202 | match self { |
782069860236 | atagen | 2026-10-10 12:44 UTC | 203 | Self::Ruptured { .. } => "vascular-event", |
782069860236 | atagen | 2026-10-10 12:44 UTC | 204 | Self::Caught => "caught", |
0d604ee39751 | atagen | 2026-10-10 14:15 UTC | 205 | Self::Opened => "opened", |
782069860236 | atagen | 2026-10-10 12:44 UTC | 206 | Self::Banned => "banned", |
782069860236 | atagen | 2026-10-10 12:44 UTC | 207 | Self::Degloved => "degloved", |
9683736a2c5e | atagen | 2026-10-10 13:15 UTC | 208 | Self::Zip => "zip", |
0a0bfee8329e | atagen | 2026-10-11 05:11 UTC | 209 | Self::Meloned => "watermelon", |
782069860236 | atagen | 2026-10-10 12:44 UTC | 210 | Self::Abandoned => "abandoned", |
782069860236 | atagen | 2026-10-10 12:44 UTC | 211 | } |
782069860236 | atagen | 2026-10-10 12:44 UTC | 212 | } |
782069860236 | atagen | 2026-10-10 12:44 UTC | 213 | |
782069860236 | atagen | 2026-10-10 12:44 UTC | 214 | pub fn detail(self) -> &'static str { |
782069860236 | atagen | 2026-10-10 12:44 UTC | 215 | match self { |
782069860236 | atagen | 2026-10-10 12:44 UTC | 216 | Self::Ruptured { ice_unused: true } => { |
782069860236 | atagen | 2026-10-10 12:44 UTC | 217 | "A vessel has exceeded its rated pressure. The run has ended. An ice pack was available and was not used." |
782069860236 | atagen | 2026-10-10 12:44 UTC | 218 | } |
782069860236 | atagen | 2026-10-10 12:44 UTC | 219 | Self::Ruptured { ice_unused: false } => { |
782069860236 | atagen | 2026-10-10 12:44 UTC | 220 | "A vessel has exceeded its rated pressure. The run has ended." |
782069860236 | atagen | 2026-10-10 12:44 UTC | 221 | } |
782069860236 | atagen | 2026-10-10 12:44 UTC | 222 | Self::Caught => { |
9683736a2c5e | atagen | 2026-10-10 13:15 UTC | 223 | "Mum has seen enough. The run has ended. Nobody will mention it at dinner." |
782069860236 | atagen | 2026-10-10 12:44 UTC | 224 | } |
0d604ee39751 | atagen | 2026-10-10 14:15 UTC | 225 | Self::Opened => { |
0d604ee39751 | atagen | 2026-10-10 14:15 UTC | 226 | "Mum has stopped knocking and opened the door. The run has ended. Nobody will mention it at dinner." |
0d604ee39751 | atagen | 2026-10-10 14:15 UTC | 227 | } |
782069860236 | atagen | 2026-10-10 12:44 UTC | 228 | Self::Banned => "Your account has been banned. The forum can tell. The run has ended.", |
782069860236 | atagen | 2026-10-10 12:44 UTC | 229 | Self::Degloved => { |
782069860236 | atagen | 2026-10-10 12:44 UTC | 230 | "The outer layer has been removed in one piece. It will not be returning. The run has ended." |
782069860236 | atagen | 2026-10-10 12:44 UTC | 231 | } |
9683736a2c5e | atagen | 2026-10-10 13:15 UTC | 232 | Self::Zip => { |
9683736a2c5e | atagen | 2026-10-10 13:15 UTC | 233 | "The request conflicts with the current state of the zip. The run has ended." |
782069860236 | atagen | 2026-10-10 12:44 UTC | 234 | } |
0a0bfee8329e | atagen | 2026-10-11 05:11 UTC | 235 | Self::Meloned => { |
0a0bfee8329e | atagen | 2026-10-11 05:11 UTC | 236 | "You have been caught with the watermelon. Nobody will mention it at dinner. The run has ended." |
0a0bfee8329e | atagen | 2026-10-11 05:11 UTC | 237 | } |
782069860236 | atagen | 2026-10-10 12:44 UTC | 238 | Self::Abandoned => "The run was abandoned.", |
782069860236 | atagen | 2026-10-10 12:44 UTC | 239 | } |
782069860236 | atagen | 2026-10-10 12:44 UTC | 240 | } |
782069860236 | atagen | 2026-10-10 12:44 UTC | 241 | |
782069860236 | atagen | 2026-10-10 12:44 UTC | 242 | fn status(self) -> StatusCode { |
782069860236 | atagen | 2026-10-10 12:44 UTC | 243 | match self { |
782069860236 | atagen | 2026-10-10 12:44 UTC | 244 | Self::Ruptured { .. } => StatusCode::INTERNAL_SERVER_ERROR, |
0d604ee39751 | atagen | 2026-10-10 14:15 UTC | 245 | Self::Caught | Self::Opened | Self::Degloved | Self::Abandoned => StatusCode::GONE, |
0a0bfee8329e | atagen | 2026-10-11 05:11 UTC | 246 | Self::Meloned => StatusCode::GONE, |
782069860236 | atagen | 2026-10-10 12:44 UTC | 247 | Self::Banned => StatusCode::FORBIDDEN, |
9683736a2c5e | atagen | 2026-10-10 13:15 UTC | 248 | Self::Zip => StatusCode::CONFLICT, |
782069860236 | atagen | 2026-10-10 12:44 UTC | 249 | } |
782069860236 | atagen | 2026-10-10 12:44 UTC | 250 | } |
782069860236 | atagen | 2026-10-10 12:44 UTC | 251 | |
782069860236 | atagen | 2026-10-10 12:44 UTC | 252 | pub fn problem(self) -> Problem { |
782069860236 | atagen | 2026-10-10 12:44 UTC | 253 | Problem::new(self.status(), self.slug(), self.detail()) |
782069860236 | atagen | 2026-10-10 12:44 UTC | 254 | } |
782069860236 | atagen | 2026-10-10 12:44 UTC | 255 | } |
782069860236 | atagen | 2026-10-10 12:44 UTC | 256 | |
782069860236 | atagen | 2026-10-10 12:44 UTC | 257 | pub struct Ending { |
782069860236 | atagen | 2026-10-10 12:44 UTC | 258 | pub cause: Cause, |
782069860236 | atagen | 2026-10-10 12:44 UTC | 259 | pub turn: u32, |
782069860236 | atagen | 2026-10-10 12:44 UTC | 260 | } |
782069860236 | atagen | 2026-10-10 12:44 UTC | 261 | |
782069860236 | atagen | 2026-10-10 12:44 UTC | 262 | pub struct Pending { |
782069860236 | atagen | 2026-10-10 12:44 UTC | 263 | pub due: u32, |
782069860236 | atagen | 2026-10-10 12:44 UTC | 264 | pub length: f64, |
782069860236 | atagen | 2026-10-10 12:44 UTC | 265 | pub girth: f64, |
782069860236 | atagen | 2026-10-10 12:44 UTC | 266 | } |