Struct ink_metadata::MessageSpecBuilder
source · pub struct MessageSpecBuilder<F, Selector, Mutates, IsPayable, Returns>where
F: Form,{ /* private fields */ }
Expand description
A builder for messages.
Developer Note
Some fields are guarded by a type-state pattern to fail at compile-time instead of at run-time. This is useful to better debug code-gen macros.
Implementations§
source§impl<F, M, P, R> MessageSpecBuilder<F, Missing<Selector>, M, P, R>where
F: Form,
impl<F, M, P, R> MessageSpecBuilder<F, Missing<Selector>, M, P, R>where
F: Form,
sourcepub fn selector(
self,
selector: [u8; 4]
) -> MessageSpecBuilder<F, Selector, M, P, R>
pub fn selector(
self,
selector: [u8; 4]
) -> MessageSpecBuilder<F, Selector, M, P, R>
Sets the function selector of the message.
source§impl<F, S, P, R> MessageSpecBuilder<F, S, Missing<Mutates>, P, R>where
F: Form,
impl<F, S, P, R> MessageSpecBuilder<F, S, Missing<Mutates>, P, R>where
F: Form,
sourcepub fn mutates(self, mutates: bool) -> MessageSpecBuilder<F, S, Mutates, P, R>
pub fn mutates(self, mutates: bool) -> MessageSpecBuilder<F, S, Mutates, P, R>
Sets if the message is mutable, thus taking &mut self
or not thus taking
&self
.
source§impl<F, S, M, R> MessageSpecBuilder<F, S, M, Missing<IsPayable>, R>where
F: Form,
impl<F, S, M, R> MessageSpecBuilder<F, S, M, Missing<IsPayable>, R>where
F: Form,
sourcepub fn payable(
self,
is_payable: bool
) -> MessageSpecBuilder<F, S, M, IsPayable, R>
pub fn payable(
self,
is_payable: bool
) -> MessageSpecBuilder<F, S, M, IsPayable, R>
Sets if the message is payable, thus accepting value for the caller.
source§impl<F, M, S, P> MessageSpecBuilder<F, S, M, P, Missing<Returns>>where
F: Form,
impl<F, M, S, P> MessageSpecBuilder<F, S, M, P, Missing<Returns>>where
F: Form,
sourcepub fn returns(
self,
return_type: ReturnTypeSpec<F>
) -> MessageSpecBuilder<F, S, M, P, Returns>
pub fn returns(
self,
return_type: ReturnTypeSpec<F>
) -> MessageSpecBuilder<F, S, M, P, Returns>
Sets the return type of the message.
source§impl<F, S, M, P, R> MessageSpecBuilder<F, S, M, P, R>where
F: Form,
impl<F, S, M, P, R> MessageSpecBuilder<F, S, M, P, R>where
F: Form,
sourcepub fn args<A>(self, args: A) -> Selfwhere
A: IntoIterator<Item = MessageParamSpec<F>>,
pub fn args<A>(self, args: A) -> Selfwhere
A: IntoIterator<Item = MessageParamSpec<F>>,
Sets the input arguments of the message specification.
sourcepub fn docs<D>(self, docs: D) -> Selfwhere
D: IntoIterator<Item = <F as Form>::String>,
pub fn docs<D>(self, docs: D) -> Selfwhere
D: IntoIterator<Item = <F as Form>::String>,
Sets the documentation of the message specification.
source§impl<F> MessageSpecBuilder<F, Selector, Mutates, IsPayable, Returns>where
F: Form,
impl<F> MessageSpecBuilder<F, Selector, Mutates, IsPayable, Returns>where
F: Form,
sourcepub fn done(self) -> MessageSpec<F>
pub fn done(self) -> MessageSpec<F>
Finishes construction of the message.