Expand description
Each module should have its own prelude, which:
- Adds preludes of upstream crates
- Exports types with specific-enough names which mean they can safely be used downstream.
The idea is that we can just include the current crate’s prelude and avoid messing around with tons of includes. This makes refactors easier, and makes integration into the node less painful.
Feel free to add more types to the prelude
Macros§
- Creates a
String
using interpolation of runtime expressions. - Creates a
Vec
containing the arguments.
Structs§
- An ordered map based on a B-Tree.
- An ordered set based on a B-Tree.
- An error returned by
RefCell::try_borrow
. - An error returned by
RefCell::try_borrow_mut
. - A pointer type that uniquely owns a heap allocation of type
T
. - A mutable memory location.
- A doubly-linked list with owned nodes.
- A thin wrapper around a
HashMap
, which guarantees that aHashMap
usage will not result in a non-deterministic execution (simply by disallowing the iteration over its elements). - This is the struct used in the Schema
- A cell which can be written to only once.
- Zero-sized type used to mark things that “act like” they own a
T
. - A single-threaded reference-counting pointer. ‘Rc’ stands for ‘Reference Counted’.
- Wraps a borrowed reference to a value in a
RefCell
box. A wrapper type for an immutably borrowed value from aRefCell<T>
. - A mutable memory location with dynamically checked borrow rules
- A wrapper type for a mutably borrowed value from a
RefCell<T>
. - A series of indexes which describes some value in the sbor tree
- A wrapper for a full encoded SBOR payload, including the prefix byte.
- A wrapper for a reference to a valid partial SBOR payload representing a single value.
- An array of custom type kinds, and associated extra information which can attach to the type kinds
- A UTF-8–encoded, growable string.
- This enables the type to be represented as eg JSON Also used to facilitate type reconstruction
- The core primitive for interior mutability in Rust.
- A contiguous growable array type, written as
Vec<T>
, short for ‘vector’. - A double-ended queue implemented with a growable ring buffer.
- LazyCellExperimentalA value which is initialized on the first access.
- Represents additional validation that should be performed on the size.
- Represents additional validation that should be performed on the numeric value.
- SyncUnsafeCellExperimental
UnsafeCell
, butSync
. - Combines all data about a Type:
Enums§
- A clone-on-write smart pointer.
- Represents an error occurred during decoding.
- Represents an error occurred during encoding.
- The TypeId which is local to a given
Schema
. This is theSchemaTypeLink
used in a linearizedSchema
to linkTypeKind
s. - The
Option
type. See the module level documentation for more. - This is a compile-time identifier for a given type, used by the type aggregator to uniquely identify a type.
- Represents any value conforming to the SBOR value model.
- A schema for the values that a codec can decode / views as valid
- Additional validation to apply to a payload of the given type, beyond validation from the
TypeKind
’s type structure.
Constants§
Traits§
- Used to do a cheap mutable-to-mutable reference conversion.
- Used to do a cheap reference-to-reference conversion.
- The
Categorize
trait marks a rust type as having a fixed value kind for SBOR encoding/decoding. - A common trait for the ability to explicitly duplicate an object.
- This trait is used where context is required to correctly display a value.
- This trait is used where context is required to correctly serialize a value.
- Types whose values can be duplicated simply by copying bits.
?
formatting.- A data structure that can be decoded from a byte array using SBOR.
- A trait for giving a type a useful default value.
- Format trait for an empty format,
{}
. - An iterator able to yield elements from both ends.
- Custom code within the destructor.
- A data structure that can be serialized into a byte array using SBOR.
- Trait for comparisons corresponding to equivalence relations.
- An iterator that knows its exact length.
- Extend a collection with the contents of an iterator.
- The version of the call operator that takes an immutable receiver.
- The version of the call operator that takes a mutable receiver.
- The version of the call operator that takes a by-value receiver.
- Used to do value-to-value conversions while consuming the input value. It is the reciprocal of
Into
. - Conversion from an
Iterator
. - Parse a value from a string
- A marker trait to indicate that the type is versioned. This can be used for type bounds for requiring that types are versioned.
- A value-to-value conversion that consumes the input value. The opposite of
From
. - Conversion into an
Iterator
. - A trait for dealing with iterators.
- Trait for types that form a total order.
- Trait for comparisons using the equality operator.
- Trait for types that form a partial order.
- Represents a custom SBOR value.
- Marker trait for encoding as an Sbor Enum
- Marker trait for encoding as an Sbor Tuple
- Marker trait for a link between
TypeKind
s: - Types that can be transferred across thread boundaries.
- Types with a constant size known at compile time.
- Types for which it is safe to share references between threads.
- A generalization of
Clone
to borrowed data. - A trait for converting a value to a
String
. - Simple and safe type conversions that may fail in a controlled way under some circumstances. It is the reciprocal of
TryInto
. - An attempted conversion that consumes
self
, which may or may not be expensive. - Types that do not require any pinning guarantees.
Functions§
- Decode an instance of
T
from a slice. - Encode a
T
into byte array. - Combines a u8 with a u8 slice.
- Copies a slice to a fixed-sized array.
- Disposes of a value.
- Creates an empty map with capacity 0 and default Hasher
- Creates an empty map with given capacity and default Hasher
- Creates an empty set with capacity 0 and default Hasher
- Creates an empty set with given capacity and default Hasher
- This is safe for std and no-std use cases (unlike
IndexMap::new
which disappears when std is not in the toolchain - see this article for deep technical reasons) - This is safe for std and no-std use cases (unlike
IndexMap::with_capacity
which disappears when std is not in the toolchain - see this article for deep technical reasons) - This is safe for std and no-std use cases (unlike
IndexSet::new
which disappears when std is not in the toolchain - see this article for deep technical reasons) - This is safe for std and no-std use cases (unlike
IndexSet::with_capacity
which disappears when std is not in the toolchain - see this article for deep technical reasons)
Type Aliases§
Derive Macros§
- Derive code that returns the value kind - specifically for Basic SBOR.
- Derive code that decodes this data structure from a byte array - specifically for Basic SBOR.
- Derive code that describes the type - specifically for Basic SBOR.
- Derive code that encodes this data structure - specifically for Basic SBOR.
- Derive code that returns the value kind.
- Derive macro generating an impl of the trait
Clone
. - Derive macro generating an impl of the trait
Copy
. - Derive macro generating an impl of the trait
Debug
. - Derive code that decodes this data structure from a byte array.
- Derive macro generating an impl of the trait
Default
. - Derive code that encodes this data structure
- Derive macro generating an impl of the trait
Eq
. - Derive macro generating an impl of the trait
PartialOrd
. The behavior of this macro is described in detail here.