Struct cosmwasm_std::IbcReceiveResponse [−][src]
#[non_exhaustive]pub struct IbcReceiveResponse<T = Empty> {
pub acknowledgement: Binary,
pub messages: Vec<SubMsg<T>>,
pub attributes: Vec<Attribute>,
pub events: Vec<Event>,
}Fields (Non-exhaustive)
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.acknowledgement: BinaryThe bytes we return to the contract that sent the packet. This may represent a success or error of exection
messages: Vec<SubMsg<T>>Optional list of messages to pass. These will be executed in order.
If the ReplyOn member is set, they will invoke this contract’s reply entry point
after execution. Otherwise, they act like “fire and forget”.
Use call or msg.into() to create messages with the older “fire and forget” semantics.
attributes: Vec<Attribute>The attributes that will be emitted as part of a “wasm” event.
More info about events (and their attributes) can be found in Cosmos SDK docs.
events: Vec<Event>Extra, custom events separate from the main wasm one. These will have
wasm- prepended to the type.
More info about events can be found in Cosmos SDK docs.
Implementations
Add an attribute included in the main wasm event.
This creates a “fire and forget” message, by using SubMsg::new() to wrap it,
and adds it to the list of messages to process.
This takes an explicit SubMsg (creates via eg. reply_on_error)
and adds it to the list of messages to process.
Adds an extra event to the response, separate from the main wasm event
that is always created.
The wasm- prefix will be appended by the runtime to the provided type
of event.
Bulk add attributes included in the main wasm event.
Anything that can be turned into an iterator and yields something
that can be converted into an Attribute is accepted.
Examples
use cosmwasm_std::{attr, IbcReceiveResponse};
let attrs = vec![
("action", "reaction"),
("answer", "42"),
("another", "attribute"),
];
let res: IbcReceiveResponse = IbcReceiveResponse::new().add_attributes(attrs.clone());
assert_eq!(res.attributes, attrs);Bulk add “fire and forget” messages to the list of messages to process.
Examples
use cosmwasm_std::{CosmosMsg, IbcReceiveResponse};
fn make_response_with_msgs(msgs: Vec<CosmosMsg>) -> IbcReceiveResponse {
IbcReceiveResponse::new().add_messages(msgs)
}Bulk add explicit SubMsg structs to the list of messages to process.
Examples
use cosmwasm_std::{SubMsg, IbcReceiveResponse};
fn make_response_with_submsgs(msgs: Vec<SubMsg>) -> IbcReceiveResponse {
IbcReceiveResponse::new().add_submessages(msgs)
}Bulk add custom events to the response. These are separate from the main
wasm event.
The wasm- prefix will be appended by the runtime to the provided types
of events.
Trait Implementations
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
This method tests for self and other values to be equal, and is used
by ==. Read more
This method tests for !=.
Auto Trait Implementations
impl<T> RefUnwindSafe for IbcReceiveResponse<T> where
T: RefUnwindSafe,
impl<T> Send for IbcReceiveResponse<T> where
T: Send,
impl<T> Sync for IbcReceiveResponse<T> where
T: Sync,
impl<T> Unpin for IbcReceiveResponse<T> where
T: Unpin,
impl<T> UnwindSafe for IbcReceiveResponse<T> where
T: UnwindSafe,
Blanket Implementations
Mutably borrows from an owned value. Read more