Struct situ::Ref

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

An immutable reference, like &T.

Internally, the reference is stored as a pointer to avoid provenance narrowing.

Implementations

Creates a new Ref from a shared pointer.

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

Returns a pointer to the referenced value.

Trait Implementations

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
The resulting type after dereferencing.
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.
The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
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.