#[repr(C)]
pub struct RelVec<T, A: RawRegionalAllocator, B: Basis = DefaultBasis> { /* private fields */ }
Expand description

A relative counterpart to Vec.

Implementations

Returns true if the RelVec contains no elements.

Returns the number of elements in the RelVec.

Returns a raw pointer to the RelVec’s buffer, or a dangling raw pointer valid for zero sized reads if the RelVec didn’t allocate.

Returns an unsafe mutable pointer to the RelVec’s buffer, or a dangling raw pointer valid for zero sized reads if the RelVec didn’t allocate.

Forces the length of the vector to new_len.

Safety
  • new_len must be less than or equal to capacity().
  • The elements at old_len..new_len must be initialized.

Returns the maximum number of elements the RelVec can contain before resizing.

Returns a reference to the underlying allocator.

Returns a Ref to a slice of the elements in the RelVec.

Reserves capacity for at least additional more elements to be inserted in the given RelVec<T>. The collection may reserve more space to speculatively avoid frequent reallocations. After calling reserve, the capacity will be greater than or equal to self.len() + additional. Does nothing if capacity is already sufficient.

Panics

Panics if the new capacity exceeds isize::MAX bytes.

Appends an element to the back of a collection.

Panics

Panics if the new capacity exceeds isize::MAX bytes.

Extends the RelVec with the contents of an iterator.

Clears the RelVec, removing all values.

Note that this method has no effect on the allocated capacity of the RelVec.

Trait Implementations

Formats the value using the given formatter.
Mutably dereferences the value.
The resulting type after dereferencing.
Dereferences the value.
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
Performs the mutable indexing (container[index]) operation. Read more
Performs the mutable indexing (container[index]) operation without performing bounds checking Read more
The returned type after indexing.
Performs the indexing (container[index]) operation. Read more
Performs the indexing (container[index]) operation without performing bounds checking 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
The metadata associated with the pointee in the chosen basis.
An error occurred while converting metadata from the native representation. Read more
An error occurred while converting metadata to the native representation. Read more
Returns the pointer metadata in B corresponding to the given native pointer metadata, or Err if the conversion failed. Read more
Returns the native pointer metadata corresponding to the given pointer metadata in B, or Err if the conversion failed. 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.

Moves a value into a given slot within some memory region. Read more
Moves a Sized value into a given slot within some memory region.
Moves a Sized value into a given slot within some memory region. Read more
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.