Configures these flags with the specified trap code `code`.
(mut self, code: Option<TrapCode>)
| 211 | |
| 212 | /// Configures these flags with the specified trap code `code`. |
| 213 | pub const fn with_trap_code(mut self, code: Option<TrapCode>) -> Self { |
| 214 | let bits = match code { |
| 215 | Some(code) => code.as_raw().get() as u16, |
| 216 | None => 0, |
| 217 | }; |
| 218 | self.bits &= !MASK_TRAP_CODE; |
| 219 | self.bits |= bits << TRAP_CODE_OFFSET; |
| 220 | self |
| 221 | } |
| 222 | } |
| 223 | |
| 224 | impl fmt::Display for MachMemFlags { |
no test coverage detected