Struct ink_lang_ir::Constructor
source · [−]pub struct Constructor { /* private fields */ }
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
sourceimpl Constructor
impl Constructor
Trait Implementations
sourceimpl Callable for Constructor
impl Callable for Constructor
sourcefn kind(&self) -> CallableKind
fn kind(&self) -> CallableKind
Returns the kind of the ink! callable.
sourcefn user_provided_selector(&self) -> Option<&Selector>
fn user_provided_selector(&self) -> Option<&Selector>
Returns the selector of the ink! callable if any has been manually set.
sourcefn has_wildcard_selector(&self) -> bool
fn has_wildcard_selector(&self) -> bool
Returns
true
if the ink! callable is flagged as a wildcard selector.sourcefn is_payable(&self) -> bool
fn is_payable(&self) -> bool
Returns
true
if the ink! callable is flagged as payable. Read moresourcefn visibility(&self) -> Visibility
fn visibility(&self) -> Visibility
Returns the visibility of the ink! callable.
sourcefn inputs(&self) -> InputsIter<'_>ⓘNotable traits for InputsIter<'a>impl<'a> Iterator for InputsIter<'a> type Item = &'a PatType;
fn inputs(&self) -> InputsIter<'_>ⓘNotable traits for InputsIter<'a>impl<'a> Iterator for InputsIter<'a> type Item = &'a PatType;
Returns an iterator yielding all input parameters of the ink! callable.
sourcefn inputs_span(&self) -> Span
fn inputs_span(&self) -> Span
Returns the span of the inputs of the ink! callable.
sourcefn statements(&self) -> &[Stmt]
fn statements(&self) -> &[Stmt]
Returns a slice over shared references to the statements of the callable.
sourceimpl Debug for Constructor
impl Debug for Constructor
sourceimpl<'a> From<&'a Constructor> for InputsIter<'a>
impl<'a> From<&'a Constructor> for InputsIter<'a>
sourcefn from(constructor: &'a Constructor) -> Self
fn from(constructor: &'a Constructor) -> Self
Converts to this type from the input type.
sourceimpl PartialEq<Constructor> for Constructor
impl PartialEq<Constructor> for Constructor
sourcefn eq(&self, other: &Constructor) -> bool
fn eq(&self, other: &Constructor) -> bool
sourceimpl ToTokens for Constructor
impl ToTokens for Constructor
sourcefn to_tokens(&self, tokens: &mut TokenStream)
fn to_tokens(&self, tokens: &mut TokenStream)
We mainly implement this trait for this ink! type to have a derived
Spanned
implementation for it.
sourcefn to_token_stream(&self) -> TokenStream
fn to_token_stream(&self) -> TokenStream
sourcefn into_token_stream(self) -> TokenStream
fn into_token_stream(self) -> TokenStream
sourceimpl TryFrom<ImplItemMethod> for Constructor
impl TryFrom<ImplItemMethod> for Constructor
impl Eq for Constructor
impl StructuralEq for Constructor
impl StructuralPartialEq for Constructor
Auto Trait Implementations
impl RefUnwindSafe for Constructor
impl !Send for Constructor
impl !Sync for Constructor
impl Unpin for Constructor
impl UnwindSafe for Constructor
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Spanned for Twhere
T: Spanned + ?Sized,
impl<T> Spanned for Twhere
T: Spanned + ?Sized,
sourcefn span(&self) -> Span
fn span(&self) -> Span
Returns a
Span
covering the complete contents of this syntax tree
node, or Span::call_site()
if this node is empty. Read more