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 literals(values: Vec<String>) -> HelperBranchBody
pub fn literals(values: Vec<String>) -> HelperBranchBody
Build a literal-bodied branch payload.
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<HelperBranchBody, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<HelperBranchBody, <__D as Deserializer<'de>>::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
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.