[][src]Struct near_bindgen_core::initializer_attribute::InitAttr

pub struct InitAttr {
    pub ident: Ident,
}

Parses the following syntax of an attribute of an attribute macro.

Example:

Suppose this is the code that declares that the smart contract can be initialized with new.

This example is not tested
#[near_bindgen]
struct A {
    a: u64,
    b: String,
}

#[near_bindgen(init => new)]
impl A {
    pub fn new(a: u64, b: String) -> Self {
        Self {a, b}
    }
}

What we parse in this module is the following custom syntax: init => new.

Fields

ident: Ident

Trait Implementations

impl Parse for InitAttr[src]

Auto Trait Implementations

impl !Send for InitAttr

impl !Sync for InitAttr

impl Unpin for InitAttr

impl UnwindSafe for InitAttr

impl !RefUnwindSafe for InitAttr

Blanket Implementations

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]