[][src]Struct region_buffer::RegionBuffer

pub struct RegionBuffer<T> { /* fields omitted */ }

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

Methods

impl<T> RegionBuffer<T>
[src]

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.

impl<T: Clone> RegionBuffer<T>
[src]

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

impl<T: Default> Default for RegionBuffer<T>
[src]

impl<T: Debug> Debug for RegionBuffer<T>
[src]

Auto Trait Implementations

impl<T> Send for RegionBuffer<T> where
    T: Send

impl<T> Sync for RegionBuffer<T> where
    T: Sync

Blanket Implementations

impl<T> From for T
[src]

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom for T where
    T: From<U>, 
[src]

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]