pub unsafe trait RevMoveOutFieldImpl<This: ?Sized>: RevIntoFieldImpl<This> + ShallowFieldPath {
// Required method
unsafe fn rev_move_out_field(
self,
this: &mut This,
moved: &mut MovedOutFields,
) -> Result<Self::Ty, Self::Err>
where Self::Ty: Sized;
}
Expand description
Like Into*Field::move_out_*field_
,except that the parameters are reversed,
This
is the type we are accessing,and Self
is a field path.
This is used by the implementations of the RevIntoMultiFieldImpl
trait.
§Safety
Implementors of this traits must do any of:
-
Delegate their implementations to the
IntoField
andIntoVariantField
traits. -
Be implemented following the safety requirements of the
IntoField
(if it’s moving out a struct field) orIntoVariantField
(if it’s moving out an enum field).
Required Methods§
Sourceunsafe fn rev_move_out_field(
self,
this: &mut This,
moved: &mut MovedOutFields,
) -> Result<Self::Ty, Self::Err>
unsafe fn rev_move_out_field( self, this: &mut This, moved: &mut MovedOutFields, ) -> Result<Self::Ty, Self::Err>
Moves out the field that self
represents inside of this
.
§Safety
The same instance of MovedOutFields
must be passed to every call to
rev_move_out_field
on the same instance of this
,
as well as not mutating that MovedOutFields
instance outside of
rev_move_out_field
with the same This
parameter.
Each field must be moved with any method at most once on the same instance of This
.
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.