pub enum HelperBranchBody {
Literals {
values: Vec<String>,
},
Nested {
branches: Vec<HelperBranch>,
},
}Expand description
What a HelperBranch produces when its guard is live.
Variants§
Literals
Flat list of literal alternatives. Empty means the branch resolves to no statically-known literal.
Nested
Branch body is itself a typed if/else chain.
Fields
§
branches: Vec<HelperBranch>Nested control-flow branches in source order.
Implementations§
Source§impl HelperBranchBody
impl HelperBranchBody
Sourcepub fn all_literals(&self) -> Vec<String>
pub fn all_literals(&self) -> Vec<String>
Returns every distinct literal reachable from this branch body.
Trait Implementations§
Source§impl Clone for HelperBranchBody
impl Clone for HelperBranchBody
Source§fn clone(&self) -> HelperBranchBody
fn clone(&self) -> HelperBranchBody
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for HelperBranchBody
impl Debug for HelperBranchBody
Source§impl<'de> Deserialize<'de> for HelperBranchBody
impl<'de> Deserialize<'de> for HelperBranchBody
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for HelperBranchBody
Source§impl Hash for HelperBranchBody
impl Hash for HelperBranchBody
Source§impl Ord for HelperBranchBody
impl Ord for HelperBranchBody
Source§fn cmp(&self, other: &HelperBranchBody) -> Ordering
fn cmp(&self, other: &HelperBranchBody) -> Ordering
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for HelperBranchBody
impl PartialEq for HelperBranchBody
Source§impl PartialOrd for HelperBranchBody
impl PartialOrd for HelperBranchBody
Source§impl Serialize for HelperBranchBody
impl Serialize for HelperBranchBody
impl StructuralPartialEq for HelperBranchBody
Auto Trait Implementations§
impl Freeze for HelperBranchBody
impl RefUnwindSafe for HelperBranchBody
impl Send for HelperBranchBody
impl Sync for HelperBranchBody
impl Unpin for HelperBranchBody
impl UnsafeUnpin for HelperBranchBody
impl UnwindSafe for HelperBranchBody
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