Struct situ::Mut

source · []
pub struct Mut<'a, T: ?Sized> { /* private fields */ }
Expand description

An immovable mutable reference, like &mut T that cannot be relocated.

Implementations

Creates a new Mut from an exclusively borrowed pointer.

Safety
  • ptr must be non-null, properly aligned, and valid for reads and writes.
  • ptr must not alias any other accessible references for 'a.
  • The value pointed to by ptr must be initialized and immovable.

Constructs a new Mut by mapping the interior pointer.

Safety
  • The pointer returned by f must be non-null, properly aligned, and valid for reads and writes.
  • The pointer returned by f must not alias any other accessible references for 'a.
  • The value pointed to by the pointer returned by f must be initialized and immutable.

Returns a pointer to the referenced value.

Returns a NonNull to the referenced value.

Returns a Ref of the referenced value.

Returns a reborrowed Mut of the referenced value.

Assumes ownership of the value in the Mut.

Safety
  • The value pointed to by the Mut must be valid for dropping.
  • The caller must ensure that the value pointed to by the Mut is never accessed in an illegal state. Because Val may drop the value, care must be taken to forget the Val or replace the value after dropping it.

Trait Implementations

Formats the value using the given formatter. Read more
The resulting type after dereferencing.
Dereferences the value.
Mutably dereferences the value.
The underlying type that is destructured.
The type of destructuring to perform.
Returns a mutable pointer to the underlying type.
Formats the value using the given formatter. Read more
The target value of this type.
Returns a pointer to this type’s target.
The restructured version of this type.
Restructures a pointer to this type into the target type. Read more

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
Formats the value using the given formatter.
Formats the value using the given formatter.

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 for metadata in pointers and references to Self.
Converts the given value to a String. Read more
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.