pub struct RegionBuffer<T> { /* private fields */ }
Expand description

A contiguous growable array type, allow you to obtain multiple mutable regions from it, as long these regions don’t overlap.

Implementations

Constructs a new, empty RegionBuffer<T>. The buffer will not allocate until elements are pushed onto it.

Appends an element to the back of a collection.

Panics

Panics if the number of elements in the buffer overflows a usize.

Returns the number of elements in the buffer, also referred to as its ‘length’.

Returns true if the region buffer contains no elements.

Shortens the buffer, keeping the first len elements and dropping the rest. If len is greater than the buffer’s current length, this has no effect.

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

Panics

If len is less than an already borrowed region.

Provides a mutable reference to a region in the buffer, provided that region hasn’t already been borrowed.

Panics

If the region has already been borrowed.

Returns a single element from the buffer. The borrowing rules also apply to this single element, so you can’t get a single element from an already borrowed region and vice versa.

Returns a single mutable element from the buffer. The borrowing rules also apply to this single element, so you can’t get a single element from an already borrowed region and vice versa.

Initialise a buffer of len size, with all elements initialised to element.

Expands the region by to size, with all new elements initialised to element.

Trait Implementations

Formats the value using the given formatter. Read more
Returns the “default value” for a 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

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.