Expand description
Shareable Substrate types.
Re-exports§
pub use self::hash::convert_hash;
pub use crypto::ByteArray;
pub use crypto::DeriveJunction;
pub use crypto::Pair;
pub use crypto::Public;
pub use serde;
pub use sp_crypto_hashing as hashing;
pub use paste;
pub use bounded_collections as bounded;
pub use sp_storage as storage;
Modules§
- bounded_
btree_ map - Traits, types and structs to support a bounded BTreeMap.
- bounded_
vec - Traits, types and structs to support putting a bounded vector into storage, as a raw value, map or a double map.
- const_
hex2array - Provides a const function for converting a hex string to a
u8
array at compile time, when used in the proper context. - crypto
- Cryptographic utilities.
- crypto_
bytes - Generic byte array which can be specialized with a marker type.
- defer
- Contains the
crate::defer!
macro for deferring the execution of code until the current scope is dropped. This helps with always executing cleanup code. - ecdsa
- Simple ECDSA secp256k1 API.
- ed25519
- Simple Ed25519 API.
- hash
- A fixed hash type.
- hexdisplay
- Wrapper type for byte collections that outputs hex.
- offchain
- Offchain workers types
- paired_
crypto - API for using a pair of crypto schemes together.
- sr25519
- Simple sr25519 (Schnorr-Ristretto) API.
- testing
- Types that should only be used for testing!
- traits
- Shareable Substrate traits.
- uint
- An unsigned fixed-size integer.
Macros§
- bounded_
btree_ map - Build a bounded btree-map from the given literals.
- bounded_
vec - Build a bounded vec from the given literals.
- defer
- Executes the given code when the current scope is dropped.
- generate_
feature_ enabled_ macro - Generates a macro for checking if a certain feature is enabled.
- hex2array
- Provides a const array from given string literal.
- impl_
maybe_ marker - Macro for creating
Maybe*
marker traits. - impl_
maybe_ marker_ std_ or_ serde - Macro for creating
Maybe*
marker traits. - map
- Initialize a key-value collection from array.
- parameter_
types - Create new implementations of the
Get
trait. - wasm_
export_ functions - Macro for exporting functions from wasm in with the expected signature for using it with the wasm executor. This is useful for tests where you need to call a function in wasm.
Structs§
- Blake2
Hasher - Concrete implementation of Hasher using Blake2b 256-bit hashes
- Bytes
- Hex-serialized shim for
Vec<u8>
. - Const
Bool - Const getter for a basic type.
- ConstI8
- Const getter for a basic type.
- Const
I16 - Const getter for a basic type.
- Const
I32 - Const getter for a basic type.
- Const
I64 - Const getter for a basic type.
- Const
I128 - Const getter for a basic type.
- ConstU8
- Const getter for a basic type.
- Const
U16 - Const getter for a basic type.
- Const
U32 - Const getter for a basic type.
- Const
U64 - Const getter for a basic type.
- Const
U128 - Const getter for a basic type.
- GetDefault
- Implement Get by returning Default for any type that implements Default.
- H160
- Fixed-size uninterpreted hash type with 20 bytes (160 bits) size.
- H256
- Fixed-size uninterpreted hash type with 32 bytes (256 bits) size.
- H512
- Fixed-size uninterpreted hash type with 64 bytes (512 bits) size.
- Keccak
Hasher - Concrete implementation of Hasher using Keccak 256-bit hashes
- Opaque
Metadata - Stores the encoded
RuntimeMetadata
for the native side as opaque type. - Opaque
Peer Id - Simple blob to hold a
PeerId
without committing to its format. - U256
- Little-endian large integer type 256-bit unsigned integer.
- U512
- Little-endian large integer type 512-bits unsigned integer.
Enums§
- LogLevel
- A log level matching the one from
log
crate. - LogLevel
Filter - Log level filter that expresses which log levels should be filtered.
- Void
- The void type - it cannot exist.
Constants§
- MAX_
POSSIBLE_ ALLOCATION - The maximum number of bytes that can be allocated at one time.
Traits§
- Get
- A trait for querying a single value from a type.
- Hasher
- Trait describing an object that can hash a slice of bytes. Used to abstract
other types over the hashing algorithm. Defines a single
hash
method and anOut
associated type with the necessary bounds. - TryCollect
- Try and collect into a collection
C
. - TypeId
- Provide a simple 4 byte identifier for a type.
- Typed
Get - A trait for querying a single value from a type defined in the trait.
Functions§
- blake2_
64 - Do a Blake2 64-bit hash and return result.
- blake2_
128 - Do a Blake2 128-bit hash and return result.
- blake2_
256 - Do a Blake2 256-bit hash and return result.
- blake2_
512 - Do a Blake2 512-bit hash and return result.
- blake2_
512_ into - Do a Blake2 512-bit hash and place result in
dest
. - keccak_
256 - Do a keccak 256-bit hash and return result.
- keccak_
512 - Do a keccak 512-bit hash and return result.
- sha2_
256 - Do a sha2 256-bit hash and return result.
- twox_64
- Do a XX 64-bit hash and return result.
- twox_
64_ into - Do a XX 64-bit hash and place result in
dest
. - twox_
128 - Do a XX 128-bit hash and return result.
- twox_
256 - Do a XX 256-bit hash and return result.
- twox_
128_ into - Do a XX 128-bit hash and place result in
dest
. - twox_
256_ into - Do a XX 256-bit hash and place result in
dest
.