Crate stabby_abi

Source
Expand description

The core of the stabby ABI.

This crate is generally not meant to be used directly, but through the stabby crate.

Re-exports§

pub use tuple::Tuple2 as Tuple;
pub use crate::enums::IDeterminantProvider;
pub use result::Result;
pub use option::Option;
pub use istable::Array;
pub use istable::End;
pub use istable::IStable;
pub use rustversion as __rustversion;

Modules§

alloc
ABI-stable smart pointers and allocated data structures, with support for custom allocators.
as_mut
Helpers to treat ABI-stable types as if they were their unstable equivalents.
checked_import
How stabby exposes symbols that must be checked through canaries or reflection before being accessed to prevent UB after linking ABI-incompatible functions.
closure
Closures, but ABI-stable
enums
ABI-stable compact sum types!
future
Futures, but ABI-stable
istable
The heart of stabby: the IStable trait.
iter
ABI-stable equivalents of iterators.
num
Extending Non-Zero Types to enable niches for other values than 0.
option
Like core::option::Option, but ABI-stable with niche optimizations! A stable option for when rust’s Option<T> isn’t!
report
A very simple ABI-stable reflection framework.
result
Like core::result::Result, but ABI-stable with niche optimizations! Stable results!
slice
ABI-stable slices. Stable slices!
str
ABI-stable strs. Stable strs!
tuple
ABI-stable tuples.
typenum2
A support module for stabby’s dark magic.
vtable
Support for vtables for multi-trait objects

Macros§

assert_eq_unchecked
Expands to assert_eq in debug builds or if --cfg stabby_check_unreachable=true has been set in the RUST_FLAGS, and to if a != b {core::hint::unreachable_unchecked()} otherwise.
assert_optimal_layout
Fires a compile error if the layout of a type is deemed sub-optimal.
assert_unchecked
Expands to assert!(condition) in debug builds or if --cfg stabby_check_unreachable=true has been set in the RUST_FLAGS, and to if condition {core::hint::unreachable_unchecked()} otherwise.
canary_suffixes
dynptr
Returns the appropriate type for a stabby equivalent of a trait object.
impl_vtable_constructor
A support macro for stabby’s dark magic.
primitive_report
Generate the IStable::REPORT and IStable::ID fields for an implementation of IStable.
unreachable_unchecked
Expands to unreachable!() in debug builds or if --cfg stabby_check_unreachable=true has been set in the RUST_FLAGS, and to core::hint::unreachable_unchecked otherwise.
vtmacro
Returns the appropriate type of vtable for a trait object.

Structs§

AlignedStruct
Used by proc-macros to ensure a list of fields gets the proper end padding when specific alignments are requested.
AssertStable
A ZST that’s only allowed to exist if its generic parameter is ABI-stable.
Dyn
A stable trait object (or a stable &mut dyn)
DynRef
A stable &'a dyn Traits
FieldPair
Used by proc-macros to concatenate fields before wrapping them in a Struct to compute their layout.
NoNiches
Emulates a type of size Size and alignment Align.
StableIf
Allows removing the IStable implementation from T if Cond is not also ABI-stable.
StableLike
Lets you tell stabby that T has the same stable layout as As.
Struct
Used by proc-macros to ensure a list of fields gets the proper end padding.

Traits§

AccessAs
Provides access to a value as if it were of another type.
IPtr
Indicates that Self can be used as a pointer in dynptrs.
IPtrClone
Provides Clone support for smart pointers that allow it.
IPtrMut
Indicates that Self can be used as an unconditionally mutable pointer in dynptrs.
IPtrOwned
Provides drop support in dynptr for pointers that have at least partial ownership of their pointee.
IPtrTryAsMut
Indicates that Self can be used as a conditionally mutable pointer in dynptrs.
IntoDyn
Used to turn a pointer into a dynamic pointer.
IntoSuperTrait
Allows casting a dyn A + B into dyn A.

Functions§

assert_stable
A no-op that fails to compile if T isn’t proven ABI-stable by stabby.

Unions§

Union
Used by crate::result::Result

Attribute Macros§

export
import
stabby
The lifeblood of stabby. Click for the tutorial