Retrieve the cases of this `variant` in declaration order.
(&self)
| 446 | |
| 447 | /// Retrieve the cases of this `variant` in declaration order. |
| 448 | pub fn cases(&self) -> impl ExactSizeIterator<Item = Case<'_>> { |
| 449 | self.0.types[self.0.index] |
| 450 | .cases |
| 451 | .iter() |
| 452 | .map(|(name, ty)| Case { |
| 453 | name, |
| 454 | ty: ty.as_ref().map(|ty| Type::from(ty, &self.0.instance())), |
| 455 | }) |
| 456 | } |
| 457 | } |
| 458 | |
| 459 | impl PartialEq for Variant { |