Struct odra_ir::module::Constructor

source ·
pub struct Constructor {
    pub attrs: Vec<OdraAttribute>,
    pub impl_item: ImplItemMethod,
    pub ident: Ident,
    pub args: Punctuated<PatType, Comma>,
    pub full_sig: Signature,
}
Expand description

Odra constructor definition.

Examples

#[odra(init)]
#[other_attribute]
pub fn set_initial_value(&self, value: u32) {
    // initialization logic goes here
}

Fields

attrs: Vec<OdraAttribute>impl_item: ImplItemMethodident: Identargs: Punctuated<PatType, Comma>full_sig: Signature

Trait Implementations

Write self to the given TokenStream. Read more
Convert self directly into a TokenStream object. Read more
Convert self directly into a TokenStream object. Read more
The type returned in the event of a conversion error.
Performs the conversion.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

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

Returns a Span covering the complete contents of this syntax tree node, or Span::call_site() if this node is empty. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.