#[repr(C)]
pub struct RelPtr<T: BasisPointee<B> + ?Sized, R: Region, B: Basis> { /* private fields */ }
Expand description

A pointer that stores the difference between itself and its pointee.

Implementations

Returns the base pointer for the relative pointer.

The base of the relative pointer is always its location in memory.

Returns the mutable base pointer for the relative pointer.

The base of the relative pointer is always its location in memory.

Returns the offset of the relative pointer’s target from its base.

Returns whether the offset of the relative pointer is 0.

Returns the metadata of the relative pointer’s pointee if it is not null.

Returns the metadata of the relative pointer’s pointee.

Safety

The relative pointer must not be null.

Returns the target of the relative pointer if it is not null.

Returns the target of the relative pointer.

Safety

The relative pointer must not be null.

Returns a Ref to the target of the relative pointer.

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

Returns a mutable pointer to the target of the relative pointer if it is not null.

Returns a mutable pointer to the target of the relative pointer.

Safety

this must not be null.

Returns a Mut to the target of the relative pointer.

Safety
  • this must be non-null, properly aligned, and valid for reads and writes.
  • this must not alias any other accessible references for 'a.
  • The pointee of this must be initialized and immovable.

Sets the pointee of this RelPtr.

Trait Implementations

Drops the value pointed to by this. Read more
Returns the metadata of the T that this emplaces. Read more
Emplaces a value into a given slot within some memory region. Read more
Returns the metadata of the T that this emplaces. Read more
Emplaces a value into a given slot within some memory region. Read more
Moves a value into a given slot within some memory region. 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

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 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.