#[non_exhaustive]pub struct ItemStruct {
pub attributes: Vec<Attribute>,
pub visibility: Visibility,
pub struct_token: Struct,
pub ident: Ident,
pub body: Fields,
/* private fields */
}
Expand description
A struct item.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. }
syntax; cannot be matched against without a wildcard ..
; and struct update syntax will not work.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: Fields
The body of the struct.
Implementations§
Source§impl ItemStruct
impl ItemStruct
Sourcepub fn parse_with_meta(
parser: &mut Parser<'_>,
attributes: Vec<Attribute>,
visibility: Visibility,
) -> Result<Self, Error>
pub fn parse_with_meta( parser: &mut Parser<'_>, attributes: Vec<Attribute>, visibility: Visibility, ) -> Result<Self, Error>
Parse #ident and attach the given meta
Trait Implementations§
Source§impl Debug for ItemStruct
impl Debug for ItemStruct
Source§impl OptionSpanned for ItemStruct
impl OptionSpanned for ItemStruct
Source§fn option_span(&self) -> Option<Span>
fn option_span(&self) -> Option<Span>
Get the optional span of the type.
Source§impl Parse for ItemStruct
impl Parse for ItemStruct
Source§impl PartialEq for ItemStruct
impl PartialEq for ItemStruct
Source§impl ToTokens for ItemStruct
impl ToTokens for ItemStruct
Source§fn to_tokens(
&self,
context: &mut MacroContext<'_, '_, '_>,
stream: &mut TokenStream,
) -> Result<()>
fn to_tokens( &self, context: &mut MacroContext<'_, '_, '_>, stream: &mut TokenStream, ) -> Result<()>
Turn the current item into tokens.
Source§impl TryClone for ItemStruct
impl TryClone for ItemStruct
impl Eq for ItemStruct
impl StructuralPartialEq for ItemStruct
Auto Trait Implementations§
impl Freeze for ItemStruct
impl RefUnwindSafe for ItemStruct
impl Send for ItemStruct
impl Sync for ItemStruct
impl Unpin for ItemStruct
impl UnwindSafe for ItemStruct
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.