pub struct Body<S> {
pub statements: Vec<Terminated<S>>,
pub tail: Option<S>,
}Expand description
Statements discarded by semicolons followed by an optional returned tail.
This is analogous to a Rust block: every terminated statement is evaluated for effects, while the unterminated tail supplies the body’s value.
Fields§
§statements: Vec<Terminated<S>>Statements terminated by semicolons.
tail: Option<S>The optional unterminated value returned by the body.
Implementations§
Trait Implementations§
Source§impl<S: Lex> Lex for Body<S>
impl<S: Lex> Lex for Body<S>
Source§fn to_tokens(&self, output: &mut TokenStream)
fn to_tokens(&self, output: &mut TokenStream)
Appends this value’s token trees to
output.Source§fn to_token_stream(&self) -> TokenStream
fn to_token_stream(&self) -> TokenStream
Emits this value into a fresh token stream.
Source§impl<S: Parse> Parse for Body<S>
impl<S: Parse> Parse for Body<S>
Source§fn parse(input: &mut ParseStream) -> Result<Self, TokenParseError>
fn parse(input: &mut ParseStream) -> Result<Self, TokenParseError>
Consumes this value from
input. Read moreAuto Trait Implementations§
impl<S> Freeze for Body<S>
impl<S> RefUnwindSafe for Body<S>
impl<S> Send for Body<S>
impl<S> Sync for Body<S>
impl<S> Unpin for Body<S>
impl<S> UnsafeUnpin for Body<S>
impl<S> UnwindSafe for Body<S>
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