Struct ink_ir::InkTraitMessage

source ·
pub struct InkTraitMessage<'a> { /* private fields */ }
Expand description

A checked ink! message of an ink! trait definition.

Implementations§

source§

impl<'a> InkTraitMessage<'a>

source

pub fn attrs(&self) -> Vec<Attribute>

Returns all non-ink! attributes.

source

pub fn ink_attrs(&self) -> InkAttribute

Returns all ink! attributes.

source

pub fn sig(&self) -> &Signature

Returns the original signature of the ink! message.

source

pub fn receiver(&self) -> Receiver

Returns the self receiver of the ink! trait message.

Returns Ref for &self messages and RefMut for &mut self messages.

source

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

Returns an iterator over the inputs of the ink! trait message.

source

pub fn output(&self) -> Option<&Type>

Returns the return type of the ink! message if any.

source

pub fn ident(&self) -> &Ident

Returns the Rust identifier of the ink! message.

source

pub fn local_id(&self) -> u32

Returns a local ID unique to the ink! trait definition of the ink! trait message.

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.

source

pub fn span(&self) -> Span

Returns the span of the ink! message.

source

pub fn mutates(&self) -> bool

Returns true if the ink! message may mutate the contract storage.

Trait Implementations§

source§

impl<'a> Clone for InkTraitMessage<'a>

source§

fn clone(&self) -> InkTraitMessage<'a>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<'a> Debug for InkTraitMessage<'a>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'a> From<&'a InkTraitMessage<'a>> for InputsIter<'a>

source§

fn from(message: &'a InkTraitMessage<'_>) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

§

impl<'a> RefUnwindSafe for InkTraitMessage<'a>

§

impl<'a> !Send for InkTraitMessage<'a>

§

impl<'a> !Sync for InkTraitMessage<'a>

§

impl<'a> Unpin for InkTraitMessage<'a>

§

impl<'a> UnwindSafe for InkTraitMessage<'a>

Blanket Implementations§

source§

impl<T> Any for Twhere
    T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere
    T: ?Sized,

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere
    T: ?Sized,

const: unstable · source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere
    U: From<T>,

const: unstable · source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere
    T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere
    U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere
    U: TryFrom<T>,

§

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

The type returned in the event of a conversion error.
const: unstable · source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.