Crate ixc_core

Source
Expand description

WARNING: This is an API preview! Expect major bugs, glaring omissions, and breaking changes!

This crate defines types and macros for constructing easy to use account and module implementations. It integrates with the encoding layer but does not specify a state management framework.

§Context

The Context struct gets passed to all handler functions that interact with state but what exactly is it? In the Golang Cosmos SDK, Context was never precisely defined and ended up becoming sort of a bag of variables which were passed around everywhere. This made it difficult to understand what was actually being passed around and what was being used.

Context here is defined to have the following purposes:

Re-exports§

pub use handler::Service;
pub use account_api::create_account;
pub use result::Result;

Modules§

account_api
Basic functionality for creating and managing account lifecycle.
error
Basic error handling utilities.
handler
Handler traits for account and module handlers.
low_level
Low-level utilities for working with message structs and message packets directly.
message
The Message trait for invoking messages dynamically.
resource
Resource module.
result
Standard result types.
routing
Routing system for message packets.

Macros§

bail
Return an error with a formatted message.
ensure
Ensure a condition is true, otherwise return an error with a formatted message.
error
Create an error.

Structs§

Context
Context wraps a single message request (and possibly response as well) along with the router callbacks necessary for making nested message calls.
EventBus
An event bus that can be used to emit events.