Struct Block
pub struct Block { pub brace_token: Brace, pub stmts: Vec<Stmt> }
A braced block containing Rust statements.
Fields
brace_token: Bracestmts: Vec<Stmt>Statements in a block
Implementations
impl Block
fn parse_within(input: ParseStream<'_>) -> Result<Vec<Stmt>>Parse the body of a block as zero or more statements, possibly including one trailing expression.
Example
use ; use ; // Parse a function with no generics or parameter list. // // fn playground { // let mut x = 1; // x += 1; // println!("{}", x); // }
Trait Implementations
impl Clone for Block
fn clone(&self) -> Self
impl Parse for Block
fn parse(input: ParseStream<'_>) -> Result<Self>
impl ToTokens for Block
fn to_tokens(&self, tokens: &mut TokenStream)
Auto Trait Implementations
impl !Send for Block
impl !Sync for Block
impl Freeze for Block
impl RefUnwindSafe for Block
impl Unpin for Block
impl UnsafeUnpin for Block
impl UnwindSafe for Block
Blanket Implementations
impl<T> Any for Block
where
T: 'static + ?Sized,
fn type_id(&self) -> TypeId
impl<T> Borrow<T> for Block
where
T: ?Sized,
fn borrow(&self) -> &T
impl<T> BorrowMut<T> for Block
where
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
impl<T> CloneToUninit for Block
where
T: Clone,
unsafe fn clone_to_uninit(&self, dest: *mut u8)
impl<T> From<T> for Block
fn from(t: T) -> TReturns the argument unchanged.
impl<T> Spanned for Block
where
T: Spanned + ?Sized,
fn span(&self) -> Span
impl<T> ToOwned for Block
where
T: Clone,
type Owned = T;fn to_owned(&self) -> Tfn clone_into(&self, target: &mut T)
impl<T, U> Into<U> for Block
where
U: From<T>,
fn into(self) -> UCalls
U::from(self).That is, this conversion is whatever the implementation of
[From]<T> for Uchooses to do.
impl<T, U> TryFrom<U> for Block
where
U: Into<T>,
type Error = never;fn try_from(value: U) -> Result<T, never>
impl<T, U> TryInto<U> for Block
where
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error;fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>