Struct ink_lang_ir::Message
source · [−]pub struct Message { /* private fields */ }
Expand description
An ink! message definition.
Example
Inherent implementation message:
impl MyStorage {
#[ink(message)]
pub fn my_message(&self, input: i32) -> bool {
/* message implementation goes here */
}
}
Trait implementation message:
impl MyTrait for MyStorage {
#[ink(message)]
fn my_message(&mut self, input: bool) -> i32 {
/* message implementation goes here */
}
}
Implementations
sourceimpl Message
impl Message
sourcepub fn attrs(&self) -> &[Attribute]
pub fn attrs(&self) -> &[Attribute]
Returns a slice of all non-ink! attributes of the ink! message.
sourcepub fn local_id(&self) -> u32
pub fn local_id(&self) -> u32
Returns a local ID unique to the ink! message with respect to its implementation block.
Note
It is a compile error if two ink! trait messages share the same local ID. Although the above scenario is very unlikely since the local ID is computed solely by the identifier of the ink! message.
Trait Implementations
sourceimpl Callable for Message
impl Callable for Message
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<'a> From<&'a Message> for InputsIter<'a>
impl<'a> From<&'a Message> for InputsIter<'a>
sourceimpl ToTokens for Message
impl ToTokens for Message
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 Message
impl TryFrom<ImplItemMethod> for Message
impl Eq for Message
impl StructuralEq for Message
impl StructuralPartialEq for Message
Auto Trait Implementations
impl RefUnwindSafe for Message
impl !Send for Message
impl !Sync for Message
impl Unpin for Message
impl UnwindSafe for Message
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