Struct rune::ast::ExprSelect [−][src]
A select
expression that selects over a collection of futures.
Examples
use rune::{testing, ast}; let select = testing::roundtrip::<ast::ExprSelect>(r#" select { _ = a => 0, _ = b => {}, _ = c => {} default => () } "#); assert_eq!(4, select.branches.len()); assert!(matches!(select.branches.get(1), Some(&(ast::ExprSelectBranch::Pat(..), Some(..))))); assert!(matches!(select.branches.get(2), Some(&(ast::ExprSelectBranch::Pat(..), None)))); assert!(matches!(select.branches.get(3), Some(&(ast::ExprSelectBranch::Default(..), None))));
Fields
attributes: Vec<Attribute>
The attributes of the select
select: Select
The select
keyword.
open: OpenBrace
The open brace.
branches: Vec<(ExprSelectBranch, Option<Comma>)>
The branches of the select.
close: CloseBrace
The close brace.
Implementations
impl ExprSelect
[src]
pub fn parse_with_attributes(
p: &mut Parser<'_>,
attributes: Vec<Attribute>
) -> Result<Self, ParseError>
[src]
p: &mut Parser<'_>,
attributes: Vec<Attribute>
) -> Result<Self, ParseError>
Parse the select
expression and attach the given attributes
Trait Implementations
impl Clone for ExprSelect
[src]
fn clone(&self) -> ExprSelect
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for ExprSelect
[src]
impl Eq for ExprSelect
[src]
impl Parse for ExprSelect
[src]
fn parse(p: &mut Parser<'_>) -> Result<Self, ParseError>
[src]
impl PartialEq<ExprSelect> for ExprSelect
[src]
fn eq(&self, other: &ExprSelect) -> bool
[src]
fn ne(&self, other: &ExprSelect) -> bool
[src]
impl Spanned for ExprSelect
[src]
impl StructuralEq for ExprSelect
[src]
impl StructuralPartialEq for ExprSelect
[src]
impl ToTokens for ExprSelect
[src]
fn to_tokens(&self, context: &MacroContext, stream: &mut TokenStream)
[src]
Auto Trait Implementations
impl RefUnwindSafe for ExprSelect
impl Send for ExprSelect
impl Sync for ExprSelect
impl Unpin for ExprSelect
impl UnwindSafe for ExprSelect
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,