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
: theIStable
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’sOption<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 theRUST_FLAGS
, and toif 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 theRUST_FLAGS
, and toif 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
andIStable::ID
fields for an implementation ofIStable
. - unreachable_
unchecked - Expands to
unreachable!()
in debug builds or if--cfg stabby_check_unreachable=true
has been set in theRUST_FLAGS
, and tocore::hint::unreachable_unchecked
otherwise. - vtmacro
- Returns the appropriate type of vtable for a trait object.
Structs§
- Aligned
Struct - Used by proc-macros to ensure a list of fields gets the proper end padding when specific alignments are requested.
- Assert
Stable - 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
- Field
Pair - 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 alignmentAlign
. - Stable
If - Allows removing the
IStable
implementation fromT
ifCond
is not also ABI-stable. - Stable
Like - Lets you tell
stabby
thatT
has the same stable layout asAs
. - Struct
- Used by proc-macros to ensure a list of fields gets the proper end padding.
Traits§
- Access
As - Provides access to a value as if it were of another type.
- IPtr
- Indicates that
Self
can be used as a pointer in dynptrs. - IPtr
Clone - Provides Clone support for smart pointers that allow it.
- IPtrMut
- Indicates that
Self
can be used as an unconditionally mutable pointer in dynptrs. - IPtr
Owned - Provides drop support in dynptr for pointers that have at least partial ownership of their pointee.
- IPtr
TryAs Mut - Indicates that
Self
can be used as a conditionally mutable pointer in dynptrs. - IntoDyn
- Used to turn a pointer into a dynamic pointer.
- Into
Super Trait - Allows casting a
dyn A + B
intodyn 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