Enum rune::ast::ItemStructBody [−][src]
AST for a struct body.
Variants
An empty struct declaration.
TupleBody(Parenthesized<Field, Comma>)
A tuple struct body.
A regular struct body.
Implementations
impl ItemStructBody
[src]
pub fn fields(&self) -> impl Iterator<Item = &(Field, Option<Comma>)>
[src]
Iterate over the fields of the body.
Trait Implementations
impl Clone for ItemStructBody
[src]
fn clone(&self) -> ItemStructBody
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for ItemStructBody
[src]
impl Eq for ItemStructBody
[src]
impl OptionSpanned for ItemStructBody
[src]
fn option_span(&self) -> Option<Span>
[src]
impl Parse for ItemStructBody
[src]
Parse implementation for a struct body.
Examples
use rune::{testing, ast}; testing::roundtrip::<ast::ItemStructBody>(""); testing::roundtrip::<ast::ItemStructBody>("{ a, b, c }"); testing::roundtrip::<ast::ItemStructBody>("{ #[x] a, #[y] b, #[z] #[w] #[f32] c }"); testing::roundtrip::<ast::ItemStructBody>("{ a, #[attribute] b, c }"); testing::roundtrip::<ast::ItemStructBody>("( a, b, c )"); testing::roundtrip::<ast::ItemStructBody>("( #[x] a, b, c )"); testing::roundtrip::<ast::ItemStructBody>("( #[x] pub a, b, c )"); testing::roundtrip::<ast::ItemStructBody>("( a, b, c )"); testing::roundtrip::<ast::ItemStructBody>("()");
fn parse(p: &mut Parser<'_>) -> Result<Self, ParseError>
[src]
impl PartialEq<ItemStructBody> for ItemStructBody
[src]
fn eq(&self, other: &ItemStructBody) -> bool
[src]
fn ne(&self, other: &ItemStructBody) -> bool
[src]
impl StructuralEq for ItemStructBody
[src]
impl StructuralPartialEq for ItemStructBody
[src]
impl ToTokens for ItemStructBody
[src]
fn to_tokens(&self, context: &MacroContext, stream: &mut TokenStream)
[src]
Auto Trait Implementations
impl RefUnwindSafe for ItemStructBody
impl Send for ItemStructBody
impl Sync for ItemStructBody
impl Unpin for ItemStructBody
impl UnwindSafe for ItemStructBody
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>,