pub unsafe trait PinField<T>: Field<T> {
type PinWrapper<'a, U: ?Sized + 'a>;
}
Expand description
Additional information on a field of a struct regarding to pinning.
§Safety
PinWrapper
must be layout-compatible with &mut Self::Type
. If the field is pinned, then
it should be Pin<&mut Self::Type>
, otherwise it should be &mut Self::Type
.
This trait should not be implemented manually; instead, use the #[derive(PinField)]
instead.
Required Associated Types§
Sourcetype PinWrapper<'a, U: ?Sized + 'a>
type PinWrapper<'a, U: ?Sized + 'a>
The type when this field is projected from a Pin<&mut Self::Base>
.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.