Trait abi_stable::pointer_trait::GetPointerKind[][src]

pub unsafe trait GetPointerKind: Sized {
    type Kind: PointerKindVariant;
    type PtrTarget;

    const KIND: PointerKind;
}
Expand description

What kind of pointer this is.

Safety

Each associated item describes their requirements for the implementor.

Associated Types

The kind of the pointer.

Safety for implementor

This is what each kind requires to be used as this associated type:

  • PK_Reference: Self must be a &T, or a Copy and #[repr(transparent)] wrapper around a primitive pointer, with &T semantics

  • PK_MutReference: Self must be a &mut T, or a non-Drop and #[repr(transparent)] wrapper around a primitive pointer, with &mut T semantics.

  • PK_SmartPointer: Any pointer type that’s neither of the two other kinds.

What this pointer points to.

This is here so that pointers don’t have to implement Deref.

Safety for implementor

If the type implements std::ops::Deref this must be the same as <Self as Deref>::Target.

Associated Constants

The value-level version of the Kind associated type.

Safety for implementor

This must not be overriden.

Implementations on Foreign Types

Implementors