pub struct Case {
pub node: NodeId,
pub name: String,
pub type_: Id<TypeNode>,
pub try_construct: Option<TryConstruct>,
pub labels: Vec<CaseLabel>,
}Expand description
One case member of a union.
The identity as well as the name, because a @mutable union’s plan
names its members the way an aggregate’s does — by node — and a walk
that had only the name would have to match on a string.
Fields§
§node: NodeIdThe member’s stable identity.
name: StringIts simple name, which is also its JSON key.
type_: Id<TypeNode>Its type, resolved.
try_construct: Option<TryConstruct>@try_construct as the case member wrote it. §7.2.2.7 lists
union members alongside structure members.
labels: Vec<CaseLabel>The labels selecting this case, in declaration order.
Carried because union_selection compares them: the probe
evaluates labels only where a setting says it must, and it needs
them in the same walk that gives it the member.
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Case
impl RefUnwindSafe for Case
impl Send for Case
impl Sync for Case
impl Unpin for Case
impl UnsafeUnpin for Case
impl UnwindSafe for Case
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more