Skip to main content

DeclSpecs

Struct DeclSpecs 

Source
pub struct DeclSpecs {
    pub storage: Option<StorageClass>,
    pub thread_local: bool,
    pub ty: TypeSpec,
    pub quals: Quals,
    pub func: FuncSpecs,
    pub align: Option<AlignSpec>,
    pub attrs: AttrList,
    pub span: Span,
}
Expand description

Everything a declaration says before its first declarator.

Fields§

§storage: Option<StorageClass>

The storage class, of which there may be at most one.

§thread_local: bool

Whether _Thread_local was written, which is separate because it is the one storage class specifier that may be combined with another.

§ty: TypeSpec

What type was named.

§quals: Quals

The qualifiers, which may be written before or after the type.

§func: FuncSpecs

inline and _Noreturn.

§align: Option<AlignSpec>

alignas, of which there may be several, of which the strictest wins. Only the first is kept here; the rest are in the side table alongside it.

§attrs: AttrList

Attributes that appertain to the declaration as a whole.

§span: Span

From the first specifier to the last.

Implementations§

Source§

impl DeclSpecs

Source

pub const fn empty(span: Span) -> DeclSpecs

A specifier list with nothing in it, which is what the parser starts from.

Source

pub const fn is_typedef(&self) -> bool

Whether this declares type names rather than objects.

Source

pub const fn deduces(&self) -> Option<Deduction>

Which spelling asked for a type deduced from an initializer, if either did.

Trait Implementations§

Source§

impl Clone for DeclSpecs

Source§

fn clone(&self) -> DeclSpecs

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for DeclSpecs

Source§

impl Debug for DeclSpecs

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for DeclSpecs

Source§

impl PartialEq for DeclSpecs

Source§

fn eq(&self, other: &DeclSpecs) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for DeclSpecs

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.