Skip to main content

Decl

Enum Decl 

Source
pub enum Decl {
    Function {
        name: Identifier,
        signature: Type,
        storage: StorageClass,
        linkage: Linkage,
    },
    Variable {
        name: Identifier,
        ty: Type,
        storage: StorageClass,
        linkage: Linkage,
    },
    Record {
        kind: RecordKind,
        path: IdentifierPath,
        bases: Vec<Base>,
        fields: Vec<Field>,
        members: Vec<Decl>,
    },
    Forward {
        kind: RecordKind,
        path: IdentifierPath,
    },
    Alias {
        path: IdentifierPath,
        target: Type,
    },
    ObjectiveCInterface {
        name: Identifier,
        superclass: Option<Identifier>,
        protocols: Vec<Identifier>,
        ivars: Vec<ObjectiveCIvar>,
        methods: Vec<ObjectiveCMethod>,
        properties: Vec<ObjectiveCProperty>,
    },
    ObjectiveCCategory {
        name: Identifier,
        extended_class: Identifier,
        protocols: Vec<Identifier>,
        methods: Vec<ObjectiveCMethod>,
        properties: Vec<ObjectiveCProperty>,
    },
    ObjectiveCProtocol {
        name: Identifier,
        protocols: Vec<Identifier>,
        methods: Vec<ObjectiveCMethod>,
        properties: Vec<ObjectiveCProperty>,
    },
    ObjectiveCForward {
        kind: ObjectiveCForwardKind,
        names: Vec<Identifier>,
    },
}
Expand description

A top-level typed declaration.

Variants§

§

Function

Function declaration.

Fields

§name: Identifier

Name.

§signature: Type

Function type.

§storage: StorageClass

Storage class.

§linkage: Linkage

Language linkage.

§

Variable

Variable declaration.

Fields

§name: Identifier

Name.

§ty: Type

Variable type.

§storage: StorageClass

Storage class.

§linkage: Linkage

Language linkage.

§

Record

Complete record declaration.

Fields

§kind: RecordKind

Record kind.

§path: IdentifierPath

Qualified name.

§bases: Vec<Base>

Base classes.

§fields: Vec<Field>

Data fields.

§members: Vec<Decl>

Nested declarations.

§

Forward

Incomplete record declaration.

Fields

§kind: RecordKind

Record kind.

§path: IdentifierPath

Qualified name.

§

Alias

Type alias.

Fields

§path: IdentifierPath

Alias name.

§target: Type

Aliased type.

§

ObjectiveCInterface

Objective-C interface.

Fields

§name: Identifier

Class name.

§superclass: Option<Identifier>

Optional superclass.

§protocols: Vec<Identifier>

Adopted protocols.

§ivars: Vec<ObjectiveCIvar>

Instance variables.

§methods: Vec<ObjectiveCMethod>

Methods.

§properties: Vec<ObjectiveCProperty>

Properties.

§

ObjectiveCCategory

Objective-C category.

Fields

§name: Identifier

Category name.

§extended_class: Identifier

Extended class.

§protocols: Vec<Identifier>

Adopted protocols.

§methods: Vec<ObjectiveCMethod>

Methods.

§properties: Vec<ObjectiveCProperty>

Properties.

§

ObjectiveCProtocol

Objective-C protocol.

Fields

§name: Identifier

Protocol name.

§protocols: Vec<Identifier>

Inherited protocols.

§methods: Vec<ObjectiveCMethod>

Methods.

§properties: Vec<ObjectiveCProperty>

Properties.

§

ObjectiveCForward

Objective-C forward declarations.

Fields

§kind: ObjectiveCForwardKind

Forward kind.

§names: Vec<Identifier>

Declared names.

Implementations§

Source§

impl Decl

Source

pub fn name(&self) -> Option<&Identifier>

Returns the declaration’s terminal name when it has one.

Trait Implementations§

Source§

impl Clone for Decl

Source§

fn clone(&self) -> Self

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 Debug for Decl

Source§

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

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

impl Eq for Decl

Source§

impl Hash for Decl

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for Decl

Source§

fn eq(&self, other: &Self) -> 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 Decl

Auto Trait Implementations§

§

impl Freeze for Decl

§

impl RefUnwindSafe for Decl

§

impl Send for Decl

§

impl Sync for Decl

§

impl Unpin for Decl

§

impl UnsafeUnpin for Decl

§

impl UnwindSafe for Decl

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, !>

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.