Trait Callable

Source
pub trait Callable {
Show 13 methods // Required methods fn kind(&self) -> CallableKind; fn ident(&self) -> &Ident; fn user_provided_selector(&self) -> Option<&Selector>; fn is_payable(&self) -> bool; fn is_default(&self) -> bool; fn has_wildcard_selector(&self) -> bool; fn has_wildcard_complement_selector(&self) -> bool; fn visibility(&self) -> Visibility; fn inputs(&self) -> InputsIter<'_> ; fn inputs_span(&self) -> Span; fn statements(&self) -> &[Stmt]; fn name(&self) -> Option<&str>; fn normalized_name(&self) -> String;
}
Expand description

An ink! callable.

This is either an ink! message or an ink! constructor. Used to share common behavior between different callable types.

Required Methods§

Source

fn kind(&self) -> CallableKind

Returns the kind of the ink! callable.

Source

fn ident(&self) -> &Ident

Returns the identifier of the ink! callable.

Source

fn user_provided_selector(&self) -> Option<&Selector>

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

Source

fn is_payable(&self) -> bool

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

§Note

Flagging as payable is done using the #[ink(payable)] attribute.

Source

fn is_default(&self) -> bool

Returns true if the ink! callable is flagged as default.

§Note

Flagging as default is done using the #[ink(default)] attribute.

Source

fn has_wildcard_selector(&self) -> bool

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

Source

fn has_wildcard_complement_selector(&self) -> bool

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

Source

fn visibility(&self) -> Visibility

Returns the visibility of the ink! callable.

Source

fn inputs(&self) -> InputsIter<'_>

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

Source

fn inputs_span(&self) -> Span

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

Source

fn statements(&self) -> &[Stmt]

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

Source

fn name(&self) -> Option<&str>

Returns the function name override (if any).

Source

fn normalized_name(&self) -> String

Returns the “normalized” function name

§Note

This returns the name override (if provided), otherwise the identifier is returned.

Implementors§