pub struct CaseOutput {
pub scrutinee: Expr,
pub brace_token: Brace,
pub cases: BTreeMap<usize, Vec<(Span, Arm)>>,
pub default: Option<(Span, Arm)>,
pub unreachable: Vec<CaseArm>,
}
Expand description
The output of vesta
’s case!
macro, in a representation suitable for turning back into tokens
via ToTokens
.
Fields§
§scrutinee: Expr
The scrutinee of the case!
.
brace_token: Brace
The brace token wrapping the whole of the cases.
cases: BTreeMap<usize, Vec<(Span, Arm)>>
The reachable cases, organized by which tag they belong to, ordered within each tag by the order they were listed in the original input.
default: Option<(Span, Arm)>
The default case _ => ...
, if there was any.
unreachable: Vec<CaseArm>
All the unreachable arms, for which we emit code so as to generate warnings.
Trait Implementations§
Source§impl Clone for CaseOutput
impl Clone for CaseOutput
Source§fn clone(&self) -> CaseOutput
fn clone(&self) -> CaseOutput
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl ToTokens for CaseOutput
impl ToTokens for CaseOutput
Source§fn to_tokens(&self, stream: &mut TokenStream)
fn to_tokens(&self, stream: &mut TokenStream)
Source§fn to_token_stream(&self) -> TokenStream
fn to_token_stream(&self) -> TokenStream
Source§fn into_token_stream(self) -> TokenStreamwhere
Self: Sized,
fn into_token_stream(self) -> TokenStreamwhere
Self: Sized,
Auto Trait Implementations§
impl Freeze for CaseOutput
impl RefUnwindSafe for CaseOutput
impl !Send for CaseOutput
impl !Sync for CaseOutput
impl Unpin for CaseOutput
impl UnwindSafe for CaseOutput
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<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Spanned for Twhere
T: Spanned + ?Sized,
impl<T> Spanned for Twhere
T: Spanned + ?Sized,
Source§fn span(&self) -> Span
fn span(&self) -> Span
Returns a
Span
covering the complete contents of this syntax tree
node, or Span::call_site()
if this node is empty.