pub struct MoveRef<'a, T: ?Sized> { /* private fields */ }
Expand description

A MoveRef<'a, T> represents an owned T whose storage location is valid but unspecified.

See the module documentation for more details.

Implementations

Creates a new MoveRef<T> out of a mutable reference.

Safety

ptr must satisfy the longest-lived criterion: after the return value goes out of scope, ptr must also be out-of-scope. Calling this function correctly is non-trivial, and should be left to moveit!() instead.

In particular, if ptr outlives the returned MoveRef, it will point to dropped memory, which is UB.

drop_flag’s value must not be dead, and must be a drop flag governing the destruction of ptr’s storage in an appropriate manner as described in moveit::drop_flag.

Converts a MoveRef<T> into a Pin<MoveRef<T>>.

Because we own the referent, we are entitled to pin it permanently. See Box::into_pin() for a standard-library equivalent.

Returns this MoveRef<T> as a raw pointer, without creating an intermediate reference.

The usual caveats for casting a reference to a pointer apply.

Returns this MoveRef<T> as a raw mutable pointer, without creating an intermediate reference.

The usual caveats for casting a reference to a pointer apply.

Consume the MoveRef<T>, returning the wrapped value.

Trait Implementations

The resulting type after dereferencing.

Dereferences the value.

The “pure storage” form of Self, which owns the storage but not the pointee. Read more

Moves out of self, producing a MoveRef that owns its contents. Read more

The “pure storage” form of Self, which owns the storage but not the pointee. Read more

Moves out of self, producing a MoveRef that owns its contents. Read more

Mutably dereferences the value.

Executes the destructor for this type. Read more

Converts to this type from the input type.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.