Struct parquet::memory::Buffer[][src]

pub struct Buffer<T: Clone> { /* fields omitted */ }

A resize-able buffer class with generic member, with optional memory tracker.

Note that a buffer has two attributes: capacity and size: the former is the total number of space reserved for the buffer, while the latter is the actual number of elements. Invariant: capacity >= size. The total allocated bytes for a buffer equals to capacity * sizeof<T>().

Methods

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

Creates new empty buffer.

Adds MemTracker for this buffer.

Returns slice of data in this buffer.

Sets data for this buffer.

Resizes underlying data in place to a new length new_size.

If new_size is less than current length, data is truncated, otherwise, it is extended to new_size with provided default value init_value.

Memory tracker is also updated, if available.

Clears underlying data.

Reserves capacity additional_capacity for underlying data vector.

Memory tracker is also updated, if available.

Returns BufferPtr with buffer data. Buffer data is reset.

Adds value to the buffer.

Returns current capacity for the buffer.

Returns current size for the buffer.

Returns true if memory tracker is added to buffer, false otherwise.

Returns memory tracker associated with this buffer. This may panic, if memory tracker is not set, use method above to check if memory tracker is available.

Trait Implementations

impl<T: Sized + Clone> Index<usize> for Buffer<T>
[src]

The returned type after indexing.

Performs the indexing (container[index]) operation.

impl<T: Sized + Clone> IndexMut<usize> for Buffer<T>
[src]

Performs the mutable indexing (container[index]) operation.

impl Write for Buffer<u8>
[src]

Write a buffer into this object, returning how many bytes were written. Read more

Flush this output stream, ensuring that all intermediately buffered contents reach their destination. Read more

Attempts to write an entire buffer into this write. Read more

Writes a formatted string into this writer, returning any error encountered. Read more

Creates a "by reference" adaptor for this instance of Write. Read more

impl AsRef<[u8]> for Buffer<u8>
[src]

Performs the conversion.

impl<T: Clone> Drop for Buffer<T>
[src]

Executes the destructor for this type. Read more

Auto Trait Implementations

impl<T> !Send for Buffer<T>

impl<T> !Sync for Buffer<T>