Struct ink_lang_ir::Constructor[][src]

pub struct Constructor { /* fields omitted */ }
Expand description

An ink! constructor definition.

Example

Inherent implementation constructor:

impl MyStorage {
    #[ink(constructor)]
    pub fn new(init_value: i32) -> Self {
        /* contract initialization goes here */
    }
}

Trait implementation constructor:

impl MyTrait for MyStorage {
    #[ink(constructor)]
    fn new(init_value: i32) -> Self {
        /* contract initialization goes here */
    }
}

Implementations

Returns a slice of all non-ink! attributes of the ink! constructor.

Trait Implementations

Returns the kind of the ink! callable.

Returns the identifier of the ink! callable.

Returns the selector of the ink! callable if any has been manually set.

Returns true if the ink! callable is flagged as a wildcard selector.

Returns true if the ink! callable is flagged as payable. Read more

Returns the visibility of the ink! callable.

Returns an iterator yielding all input parameters of the ink! callable.

Returns the span of the inputs of the ink! callable.

Returns a slice over shared references to the statements of the callable.

Formats the value using the given formatter. Read more

Performs the conversion.

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

We mainly implement this trait for this ink! type to have a derived Spanned implementation for it.

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

Performs the conversion.

Performs the conversion.

Should always be Self

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.