[][src]Trait abi_stable::abi_stability::stable_abi_trait::SharedStableAbi

pub unsafe trait SharedStableAbi {
type IsNonZeroType: Boolean;
type Kind: TypeKindTrait;
type StaticEquivalent: 'static;

const S_LAYOUT: &'static TypeLayout;
const S_ABI_INFO: &'static AbiInfoWrapper;
}

Represents a type whose layout is stable.

This trait can be derived using ``.

Safety

The layout of types implementing this trait can only change by adding fields at the end,if it stores a TLData::PrefixType in TypeLayout.data,

Caveats

This trait cannot be directly implemented for functions that take lifetime parameters, because of that,#[derive(StableAbi)] detects the presence of extern fn types in type definitions.

Associated Types

type IsNonZeroType: Boolean

Whether this type has a single invalid bit-pattern.

Possible values:True/False

Some standard library types have a single value that is invalid for them eg:0,null. these types are the only ones which can be stored in a Option<_> that implements AbiStable.

An alternative for types where IsNonZeroType=False,you can use abi_stable::ROption.

Non-exhaustive list of std types that are NonZero:

  • &T (any T).

  • &mut T (any T).

  • extern fn().

  • std::ptr::NonNull

  • std::num::NonZero*

type Kind: TypeKindTrait

The kind of abi stability of this type,there are 2:

  • ValueKind:The layout of this type does not change in minor versions.

  • PrefixKind: A struct which can add fields in minor versions, only usable behind a shared reference, used to implement extensible vtables and modules.

type StaticEquivalent: 'static

A version of the type which does not borrow anything, used to create a UTypeId for doing layout checking.

Loading content...

Associated Constants

const S_LAYOUT: &'static TypeLayout

The layout of the type provided by implementors.

const S_ABI_INFO: &'static AbiInfoWrapper

The layout of the type,derived from Self::LAYOUT and associated types.

Loading content...

Implementations on Foreign Types

impl<T> SharedStableAbi for PhantomData<T> where
    T: StableAbi
[src]

impl SharedStableAbi for ()[src]

impl SharedStableAbi for Void[src]

impl<'a, T> SharedStableAbi for &'a T where
    T: 'a + SharedStableAbi
[src]

impl<'a, T> SharedStableAbi for &'a mut T where
    T: 'a + StableAbi
[src]

impl<T> SharedStableAbi for NonNull<T> where
    T: StableAbi
[src]

impl<T> SharedStableAbi for AtomicPtr<T> where
    T: StableAbi
[src]

impl<T> SharedStableAbi for *const T where
    T: SharedStableAbi
[src]

impl<T> SharedStableAbi for *mut T where
    T: StableAbi
[src]

impl<T> SharedStableAbi for [T; 0] where
    T: StableAbi
[src]

impl<T> SharedStableAbi for [T; 1] where
    T: StableAbi
[src]

impl<T> SharedStableAbi for [T; 2] where
    T: StableAbi
[src]

impl<T> SharedStableAbi for [T; 3] where
    T: StableAbi
[src]

impl<T> SharedStableAbi for [T; 4] where
    T: StableAbi
[src]

impl<T> SharedStableAbi for [T; 5] where
    T: StableAbi
[src]

impl<T> SharedStableAbi for [T; 6] where
    T: StableAbi
[src]

impl<T> SharedStableAbi for [T; 7] where
    T: StableAbi
[src]

impl<T> SharedStableAbi for [T; 8] where
    T: StableAbi
[src]

impl<T> SharedStableAbi for [T; 9] where
    T: StableAbi
[src]

impl<T> SharedStableAbi for [T; 10] where
    T: StableAbi
[src]

impl<T> SharedStableAbi for [T; 11] where
    T: StableAbi
[src]

impl<T> SharedStableAbi for [T; 12] where
    T: StableAbi
[src]

impl<T> SharedStableAbi for [T; 13] where
    T: StableAbi
[src]

impl<T> SharedStableAbi for [T; 14] where
    T: StableAbi
[src]

impl<T> SharedStableAbi for [T; 15] where
    T: StableAbi
[src]

impl<T> SharedStableAbi for [T; 16] where
    T: StableAbi
[src]

impl<T> SharedStableAbi for [T; 17] where
    T: StableAbi
[src]

impl<T> SharedStableAbi for [T; 18] where
    T: StableAbi
[src]

impl<T> SharedStableAbi for [T; 19] where
    T: StableAbi
[src]

impl<T> SharedStableAbi for [T; 20] where
    T: StableAbi
[src]

impl<T> SharedStableAbi for [T; 21] where
    T: StableAbi
[src]

impl<T> SharedStableAbi for [T; 22] where
    T: StableAbi
[src]

impl<T> SharedStableAbi for [T; 23] where
    T: StableAbi
[src]

impl<T> SharedStableAbi for [T; 24] where
    T: StableAbi
[src]

impl<T> SharedStableAbi for [T; 25] where
    T: StableAbi
[src]

impl<T> SharedStableAbi for [T; 26] where
    T: StableAbi
[src]

impl<T> SharedStableAbi for [T; 27] where
    T: StableAbi
[src]

impl<T> SharedStableAbi for [T; 28] where
    T: StableAbi
[src]

impl<T> SharedStableAbi for [T; 29] where
    T: StableAbi
[src]

impl<T> SharedStableAbi for [T; 30] where
    T: StableAbi
[src]

impl<T> SharedStableAbi for [T; 31] where
    T: StableAbi
[src]

impl<T> SharedStableAbi for [T; 32] where
    T: StableAbi
[src]

impl<T> SharedStableAbi for Option<T> where
    T: StableAbi<IsNonZeroType = True>, 
[src]

Implementing abi stability for Option is fine if T is a NonZero primitive type.

impl SharedStableAbi for u8[src]

impl SharedStableAbi for i8[src]

impl SharedStableAbi for u16[src]

impl SharedStableAbi for i16[src]

impl SharedStableAbi for u32[src]

impl SharedStableAbi for i32[src]

impl SharedStableAbi for u64[src]

impl SharedStableAbi for i64[src]

impl SharedStableAbi for usize[src]

impl SharedStableAbi for isize[src]

impl SharedStableAbi for bool[src]

impl SharedStableAbi for AtomicBool[src]

impl SharedStableAbi for AtomicIsize[src]

impl SharedStableAbi for AtomicUsize[src]

impl SharedStableAbi for NonZeroU8[src]

impl SharedStableAbi for NonZeroU16[src]

impl SharedStableAbi for NonZeroU32[src]

impl SharedStableAbi for NonZeroU64[src]

impl SharedStableAbi for NonZeroUsize[src]

impl<P> SharedStableAbi for NumWrapping<P> where
    P: StableAbi
[src]

impl<P> SharedStableAbi for Pin<P> where
    P: StableAbi
[src]

impl<P> SharedStableAbi for ManuallyDrop<P> where
    P: StableAbi
[src]

impl<P> SharedStableAbi for Cell<P> where
    P: StableAbi
[src]

impl<P> SharedStableAbi for UnsafeCell<P> where
    P: StableAbi
[src]

impl SharedStableAbi for PhantomPinned[src]

impl SharedStableAbi for extern "C" fn()[src]

This is the only function type that implements StableAbi so as to make it more obvious that functions involving lifetimes cannot implement this trait directly (because of higher ranked trait bounds).

impl SharedStableAbi for unsafe extern "C" fn()[src]

This is the only function type that implements StableAbi so as to make it more obvious that functions involving lifetimes cannot implement this trait directly (because of higher ranked trait bounds).

Loading content...

Implementors

impl SharedStableAbi for TypeKind[src]

impl SharedStableAbi for CTVariant[src]

impl SharedStableAbi for Primitive[src]

impl SharedStableAbi for TagErrorVariant[src]

impl SharedStableAbi for TagVariant[src]

impl SharedStableAbi for LifetimeIndex[src]

impl SharedStableAbi for RustPrimitive[src]

impl SharedStableAbi for TLData[src]

impl SharedStableAbi for TLDataDiscriminant[src]

impl SharedStableAbi for FormattingMode[src]

impl SharedStableAbi for CallReferentDrop[src]

impl SharedStableAbi for PointerKind[src]

impl SharedStableAbi for IsAccessible[src]

impl SharedStableAbi for IsConditional[src]

impl SharedStableAbi for RCmpOrdering[src]

impl SharedStableAbi for RSeekFrom[src]

impl SharedStableAbi for AbiInfo[src]

impl SharedStableAbi for AbiInfoWrapper[src]

impl SharedStableAbi for GetAbiInfo where
    extern "C" fn(): __StableAbi
[src]

impl SharedStableAbi for CheckableTag[src]

impl SharedStableAbi for Tag[src]

impl SharedStableAbi for FullType[src]

impl SharedStableAbi for GenericParams[src]

impl SharedStableAbi for TLEnumVariant[src]

impl SharedStableAbi for TLField[src]

impl SharedStableAbi for TLFieldAndType where
    TLField: __StableAbi
[src]

impl SharedStableAbi for TLPrefixType[src]

impl SharedStableAbi for TypeLayout[src]

impl SharedStableAbi for CloneInterface[src]

impl SharedStableAbi for DefaultInterface[src]

impl SharedStableAbi for FmtWriteInterface[src]

impl SharedStableAbi for PartialEqInterface[src]

impl SharedStableAbi for DebugDisplayObject[src]

impl SharedStableAbi for TypeInfo[src]

impl SharedStableAbi for ErasedObject[src]

impl SharedStableAbi for NotCopyNotClone[src]

impl SharedStableAbi for SyncSend[src]

impl SharedStableAbi for UnsyncSend[src]

impl SharedStableAbi for UnsyncUnsend[src]

impl SharedStableAbi for FieldAccessibility where
    u64: __StableAbi
[src]

impl SharedStableAbi for PTField[src]

impl SharedStableAbi for PTStructLayout[src]

impl SharedStableAbi for RIoError[src]

impl SharedStableAbi for RIoErrorKind[src]

impl SharedStableAbi for RString[src]

impl SharedStableAbi for StaticStr[src]

impl SharedStableAbi for RDuration[src]

impl SharedStableAbi for UTypeId[src]

impl SharedStableAbi for VersionNumber[src]

impl SharedStableAbi for VersionStrings[src]

impl<'a> SharedStableAbi for HasherObject<'a>[src]

impl<'a> SharedStableAbi for RStr<'a>[src]

impl<'a, B: ?Sized> SharedStableAbi for RCow<'a, B> where
    B: BorrowOwned<'a>,
    <B as BorrowOwned<'a>>::RBorrowed: StableAbi,
    <B as BorrowOwned<'a>>::ROwned: StableAbi
[src]

impl<'a, K, V> SharedStableAbi for REntry<'a, K, V> where
    K: __StableAbi,
    V: __StableAbi,
    K: 'a,
    V: 'a, 
[src]

impl<'a, K, V> SharedStableAbi for ROccupiedEntry<'a, K, V> where
    V: __StableAbi,
    K: __StableAbi,
    K: 'a,
    V: 'a, 
[src]

impl<'a, K, V> SharedStableAbi for RVacantEntry<'a, K, V> where
    K: __StableAbi,
    V: __StableAbi,
    K: 'a,
    V: 'a, 
[src]

impl<'a, T> SharedStableAbi for RSlice<'a, T> where
    T: __StableAbi,
    T: 'a, 
[src]

impl<'a, T> SharedStableAbi for RSliceMut<'a, T> where
    T: __StableAbi,
    T: 'a, 
[src]

impl<'borr, P, I> SharedStableAbi for DynTrait<'borr, P, I> where
    I: InterfaceBound<'borr>,
    I: __StableAbi,
    P: __StableAbi,
    <I as SharedStableAbi>::StaticEquivalent: InterfaceBound<'static>,
    VTable<'borr, P, I>: SharedStableAbi
[src]

impl<A> SharedStableAbi for Tuple1<A> where
    A: __StableAbi
[src]

impl<A, B> SharedStableAbi for Tuple2<A, B> where
    A: __StableAbi,
    B: __StableAbi
[src]

impl<A, B, C> SharedStableAbi for Tuple3<A, B, C> where
    B: __StableAbi,
    C: __StableAbi,
    A: __StableAbi
[src]

impl<A, B, C, D> SharedStableAbi for Tuple4<A, B, C, D> where
    B: __StableAbi,
    C: __StableAbi,
    A: __StableAbi,
    D: __StableAbi
[src]

impl<K, V> SharedStableAbi for IntoIter<K, V> where
    K: __StableAbi,
    V: __StableAbi,
    DynTrait<'static, RBox<()>, ValIterInterface<u32, u32>>: __StableAbi
[src]

impl<K, V> SharedStableAbi for MutIterInterface<K, V> where
    K: __StableAbi,
    V: __StableAbi
[src]

impl<K, V> SharedStableAbi for RefIterInterface<K, V> where
    K: __StableAbi,
    V: __StableAbi
[src]

impl<K, V> SharedStableAbi for ValIterInterface<K, V> where
    V: __StableAbi,
    K: __StableAbi
[src]

impl<K, V, S> SharedStableAbi for RHashMap<K, V, S> where
    K: __StableAbi,
    V: __StableAbi
[src]

impl<M> SharedStableAbi for RBoxError_<M> where
    M: __StableAbi
[src]

impl<T> SharedStableAbi for ROption<T> where
    T: __StableAbi
[src]

impl<T> SharedStableAbi for UnsafeOpaqueField<T>[src]

type Kind = ValueKind

type IsNonZeroType = False

type StaticEquivalent = ()

it is fine to use () because this type is treated as a primitive anyway.

const S_ABI_INFO: &'static AbiInfoWrapper[src]

impl<T> SharedStableAbi for KeyValue<T> where
    T: __StableAbi
[src]

impl<T> SharedStableAbi for DEIteratorInterface<T> where
    T: __StableAbi
[src]

impl<T> SharedStableAbi for IteratorInterface<T> where
    T: __StableAbi
[src]

impl<T> SharedStableAbi for CmpIgnored<T> where
    T: __StableAbi,
    T: __StableAbi
[src]

impl<T> SharedStableAbi for UnsafeIgnoredType<T>[src]

impl<T> SharedStableAbi for RRange<T> where
    T: __StableAbi
[src]

impl<T> SharedStableAbi for RRangeFrom<T> where
    T: __StableAbi
[src]

impl<T> SharedStableAbi for RRangeInclusive<T> where
    T: __StableAbi
[src]

impl<T> SharedStableAbi for RRangeTo<T> where
    T: __StableAbi
[src]

impl<T> SharedStableAbi for RRangeToInclusive<T> where
    T: __StableAbi
[src]

impl<T> SharedStableAbi for RArc<T> where
    T: __StableAbi
[src]

impl<T> SharedStableAbi for RBox<T> where
    T: __StableAbi
[src]

impl<T> SharedStableAbi for RVec<T> where
    T: __StableAbi
[src]

impl<T, E> SharedStableAbi for RResult<T, E> where
    E: __StableAbi,
    T: __StableAbi
[src]

impl<T: 'static> SharedStableAbi for WithLayout<T> where
    T: __StableAbi
[src]

impl<T: 'static> SharedStableAbi for StaticSlice<T> where
    T: __StableAbi
[src]

Loading content...