Struct rune::ast::ItemStruct [−][src]
A struct item.
Examples
use rune::{testing, ast}; testing::roundtrip::<ast::ItemStruct>("struct Foo"); testing::roundtrip::<ast::ItemStruct>("struct Foo ( a, b, c )"); testing::roundtrip::<ast::ItemStruct>("struct Foo { a, b, c }"); testing::roundtrip::<ast::ItemStruct>("struct Foo { #[default_value = 1] a, b, c }"); testing::roundtrip::<ast::ItemStruct>("#[alpha] struct Foo ( #[default_value = \"x\" ] a, b, c )");
Fields
id: Option<Id>
Opaque identifier of the struct.
attributes: Vec<Attribute>
The attributes for the struct
visibility: Visibility
The visibility of the struct
item
struct_token: Struct
The struct
keyword.
ident: Ident
The identifier of the struct declaration.
body: ItemStructBody
The body of the struct.
Implementations
impl ItemStruct
[src]
pub fn parse_with_meta(
parser: &mut Parser<'_>,
attributes: Vec<Attribute>,
visibility: Visibility
) -> Result<Self, ParseError>
[src]
parser: &mut Parser<'_>,
attributes: Vec<Attribute>,
visibility: Visibility
) -> Result<Self, ParseError>
Parse #ident and attach the given meta
impl ItemStruct
[src]
pub fn needs_semi_colon(&self) -> bool
[src]
If the struct declaration needs to be terminated with a semicolon.
Trait Implementations
impl Clone for ItemStruct
[src]
fn clone(&self) -> ItemStruct
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for ItemStruct
[src]
impl Eq for ItemStruct
[src]
impl Parse for ItemStruct
[src]
fn parse(p: &mut Parser<'_>) -> Result<Self, ParseError>
[src]
impl PartialEq<ItemStruct> for ItemStruct
[src]
fn eq(&self, other: &ItemStruct) -> bool
[src]
fn ne(&self, other: &ItemStruct) -> bool
[src]
impl Spanned for ItemStruct
[src]
impl StructuralEq for ItemStruct
[src]
impl StructuralPartialEq for ItemStruct
[src]
impl ToTokens for ItemStruct
[src]
fn to_tokens(&self, context: &MacroContext, stream: &mut TokenStream)
[src]
Auto Trait Implementations
impl RefUnwindSafe for ItemStruct
impl Send for ItemStruct
impl Sync for ItemStruct
impl Unpin for ItemStruct
impl UnwindSafe for ItemStruct
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>,