[][src]Struct bufferpool::BufferPool

pub struct BufferPool<V: Default + Clone> { /* fields omitted */ }

A "vector of vectors" backed by a single contiguous vector. Allows for mutable borrows of non-overlapping regions.

Methods

impl<V: Default + Clone> BufferPool<V>[src]

pub fn builder() -> BufferPoolBuilder<V>[src]

pub fn get_buffer_size(&self) -> usize[src]

pub fn try_clear(&mut self) -> Result<(), ()>[src]

Set all of the values back to their defaults

pub fn clear(&mut self)[src]

Set all of the values back to their defaults

Panics

If any of the buffers have been borrowed.

pub fn capacity(&self) -> usize[src]

Return the max number of buffers

pub fn change_buffer_size(&mut self, new_buffer_size: usize)[src]

Resize the internal buffers

Panics

If any of the buffers have been borrowed.

pub fn try_change_buffer_size(
    &mut self,
    new_buffer_size: usize
) -> Result<(), ()>
[src]

Resize the internal buffers

pub fn resize_len_and_buffer(&mut self, new_len: usize, new_buffer_size: usize)[src]

Resize both the capacity and buffers

Panics

If any of the buffers have been borrowed

pub fn is_empty(&self) -> bool[src]

Check whether the buffer pool has no capacity

pub fn reserve(&mut self, additional: usize)[src]

Reserve an additional number of buffers

Panics

If any of the buffers have been borrowed

pub fn try_reserve(&mut self, additional: usize) -> Result<(), ()>[src]

Reserve an additional number of buffers

pub fn is_borrowed(&self) -> bool[src]

Checks to see whether any of the internal slices have been borrowed.

pub fn resize(&mut self, new_len: usize)[src]

Change the number of internal buffers

Panics

If any of the internal buffers have been borrowed

pub fn try_resize(&mut self, new_len: usize) -> Result<(), ()>[src]

Change the number of internal buffers

pub fn get_cleared_space(&mut self) -> Result<BufferPoolReference<V>, ()>[src]

Get a reference to a slice of the BufferPool setting the values of the pool back to their default value.

pub fn get_space(&mut self) -> Result<BufferPoolReference<V>, ()>[src]

Get a reference to a slice of the BufferPool.

Trait Implementations

impl<V: Default + Clone> Default for BufferPool<V>[src]

Auto Trait Implementations

impl<V> !RefUnwindSafe for BufferPool<V>

impl<V> !Send for BufferPool<V>

impl<V> !Sync for BufferPool<V>

impl<V> Unpin for BufferPool<V>

impl<V> !UnwindSafe for BufferPool<V>

Blanket Implementations

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

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

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

impl<T> From<T> for T[src]

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

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

type Error = Infallible

The type returned in the event of a conversion error.

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

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.