[−][src]Struct arrow::buffer::MutableBuffer
Similar to Buffer, but is growable and can be mutated. A mutable buffer can be
converted into a immutable buffer via the freeze method.
Methods
impl MutableBuffer[src]
impl MutableBufferpub fn new(capacity: usize) -> Self[src]
pub fn new(capacity: usize) -> SelfAllocate a new mutable buffer with initial capacity to be capacity.
pub fn with_bitset(self, end: usize, val: bool) -> Self[src]
pub fn with_bitset(self, end: usize, val: bool) -> SelfSet the bits in the range of [0, end) to 0 (if val is false), or 1 (if val
is true). Also extend the length of this buffer to be end.
This is useful when one wants to clear (or set) the bits and then manipulate
the buffer directly (e.g., modifying the buffer by holding a mutable reference
from data_mut()).
pub fn set_null_bits(&mut self, start: usize, count: usize)[src]
pub fn set_null_bits(&mut self, start: usize, count: usize)Ensure that count bytes from start contain zero bits
This is used to initialize the bits in a buffer, however, it has no impact on the len
of the buffer and so can be used to initialize the memory region from len to capacity.
pub fn reserve(&mut self, capacity: usize) -> Result<usize>[src]
pub fn reserve(&mut self, capacity: usize) -> Result<usize>Ensures that this buffer has at least capacity slots in this buffer. This will
also ensure the new capacity will be a multiple of 64 bytes.
Returns the new capacity for this buffer.
pub fn resize(&mut self, new_len: usize) -> Result<()>[src]
pub fn resize(&mut self, new_len: usize) -> Result<()>Resizes the buffer so that the len will equal to the new_len.
If new_len is greater than len, the buffer's length is simply adjusted to be
the former, optionally extending the capacity. The data between len and
new_len will remain unchanged.
If new_len is less than len, the buffer will be truncated.
pub fn is_empty(&self) -> bool[src]
pub fn is_empty(&self) -> boolReturns whether this buffer is empty or not.
pub fn len(&self) -> usize[src]
pub fn len(&self) -> usizeReturns the length (the number of bytes written) in this buffer.
pub fn capacity(&self) -> usize[src]
pub fn capacity(&self) -> usizeReturns the total capacity in this buffer.
pub fn clear(&mut self)[src]
pub fn clear(&mut self)Clear all existing data from this buffer.
pub fn data(&self) -> &[u8][src]
pub fn data(&self) -> &[u8]Returns the data stored in this buffer as a slice.
pub fn data_mut(&mut self) -> &mut [u8][src]
pub fn data_mut(&mut self) -> &mut [u8]Returns the data stored in this buffer as a mutable slice.
pub fn raw_data(&self) -> *const u8[src]
pub fn raw_data(&self) -> *const u8Returns a raw pointer for this buffer.
Note that this should be used cautiously, and the returned pointer should not be stored anywhere, to avoid dangling pointers.
pub fn freeze(self) -> Buffer[src]
pub fn freeze(self) -> BufferFreezes this buffer and return an immutable version of it.
Trait Implementations
impl Drop for MutableBuffer[src]
impl Drop for MutableBufferimpl Sync for MutableBuffer[src]
impl Sync for MutableBufferimpl PartialEq<MutableBuffer> for MutableBuffer[src]
impl PartialEq<MutableBuffer> for MutableBufferfn eq(&self, other: &MutableBuffer) -> bool[src]
fn eq(&self, other: &MutableBuffer) -> bool#[must_use]
fn ne(&self, other: &Rhs) -> bool1.0.0[src]
#[must_use]
fn ne(&self, other: &Rhs) -> boolThis method tests for !=.
impl Send for MutableBuffer[src]
impl Send for MutableBufferimpl Debug for MutableBuffer[src]
impl Debug for MutableBufferimpl Write for MutableBuffer[src]
impl Write for MutableBufferfn write(&mut self, buf: &[u8]) -> IoResult<usize>[src]
fn write(&mut self, buf: &[u8]) -> IoResult<usize>fn flush(&mut self) -> IoResult<()>[src]
fn flush(&mut self) -> IoResult<()>fn write_all(&mut self, buf: &[u8]) -> Result<(), Error>1.0.0[src]
fn write_all(&mut self, buf: &[u8]) -> Result<(), Error>Attempts to write an entire buffer into this write. Read more
fn write_fmt(&mut self, fmt: Arguments) -> Result<(), Error>1.0.0[src]
fn write_fmt(&mut self, fmt: Arguments) -> Result<(), Error>Writes a formatted string into this writer, returning any error encountered. Read more
fn by_ref(&mut self) -> &mut Self1.0.0[src]
fn by_ref(&mut self) -> &mut SelfCreates a "by reference" adaptor for this instance of Write. Read more
Blanket Implementations
impl<T> From for T[src]
impl<T> From for Timpl<T, U> Into for T where
U: From<T>, [src]
impl<T, U> Into for T where
U: From<T>, impl<T, U> TryFrom for T where
T: From<U>, [src]
impl<T, U> TryFrom for T where
T: From<U>, type Error = !
try_from)The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>impl<T> Borrow for T where
T: ?Sized, [src]
impl<T> Borrow for T where
T: ?Sized, impl<T> Any for T where
T: 'static + ?Sized, [src]
impl<T> Any for T where
T: 'static + ?Sized, fn get_type_id(&self) -> TypeId[src]
fn get_type_id(&self) -> TypeIdimpl<T, U> TryInto for T where
U: TryFrom<T>, [src]
impl<T, U> TryInto for T where
U: TryFrom<T>, type Error = <U as TryFrom<T>>::Error
try_from)The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>impl<T> BorrowMut for T where
T: ?Sized, [src]
impl<T> BorrowMut for T where
T: ?Sized, fn borrow_mut(&mut self) -> &mut T[src]
fn borrow_mut(&mut self) -> &mut Timpl<W> WriteBytesExt for W where
W: Write + ?Sized,
impl<W> WriteBytesExt for W where
W: Write + ?Sized, fn write_u8(&mut self, n: u8) -> Result<(), Error>
fn write_u8(&mut self, n: u8) -> Result<(), Error>Writes an unsigned 8 bit integer to the underlying writer. Read more
fn write_i8(&mut self, n: i8) -> Result<(), Error>
fn write_i8(&mut self, n: i8) -> Result<(), Error>Writes a signed 8 bit integer to the underlying writer. Read more
fn write_u16<T>(&mut self, n: u16) -> Result<(), Error> where
T: ByteOrder,
fn write_u16<T>(&mut self, n: u16) -> Result<(), Error> where
T: ByteOrder, Writes an unsigned 16 bit integer to the underlying writer. Read more
fn write_i16<T>(&mut self, n: i16) -> Result<(), Error> where
T: ByteOrder,
fn write_i16<T>(&mut self, n: i16) -> Result<(), Error> where
T: ByteOrder, Writes a signed 16 bit integer to the underlying writer. Read more
fn write_u24<T>(&mut self, n: u32) -> Result<(), Error> where
T: ByteOrder,
fn write_u24<T>(&mut self, n: u32) -> Result<(), Error> where
T: ByteOrder, Writes an unsigned 24 bit integer to the underlying writer. Read more
fn write_i24<T>(&mut self, n: i32) -> Result<(), Error> where
T: ByteOrder,
fn write_i24<T>(&mut self, n: i32) -> Result<(), Error> where
T: ByteOrder, Writes a signed 24 bit integer to the underlying writer. Read more
fn write_u32<T>(&mut self, n: u32) -> Result<(), Error> where
T: ByteOrder,
fn write_u32<T>(&mut self, n: u32) -> Result<(), Error> where
T: ByteOrder, Writes an unsigned 32 bit integer to the underlying writer. Read more
fn write_i32<T>(&mut self, n: i32) -> Result<(), Error> where
T: ByteOrder,
fn write_i32<T>(&mut self, n: i32) -> Result<(), Error> where
T: ByteOrder, Writes a signed 32 bit integer to the underlying writer. Read more
fn write_u48<T>(&mut self, n: u64) -> Result<(), Error> where
T: ByteOrder,
fn write_u48<T>(&mut self, n: u64) -> Result<(), Error> where
T: ByteOrder, Writes an unsigned 48 bit integer to the underlying writer. Read more
fn write_i48<T>(&mut self, n: i64) -> Result<(), Error> where
T: ByteOrder,
fn write_i48<T>(&mut self, n: i64) -> Result<(), Error> where
T: ByteOrder, Writes a signed 48 bit integer to the underlying writer. Read more
fn write_u64<T>(&mut self, n: u64) -> Result<(), Error> where
T: ByteOrder,
fn write_u64<T>(&mut self, n: u64) -> Result<(), Error> where
T: ByteOrder, Writes an unsigned 64 bit integer to the underlying writer. Read more
fn write_i64<T>(&mut self, n: i64) -> Result<(), Error> where
T: ByteOrder,
fn write_i64<T>(&mut self, n: i64) -> Result<(), Error> where
T: ByteOrder, Writes a signed 64 bit integer to the underlying writer. Read more
fn write_uint<T>(&mut self, n: u64, nbytes: usize) -> Result<(), Error> where
T: ByteOrder,
fn write_uint<T>(&mut self, n: u64, nbytes: usize) -> Result<(), Error> where
T: ByteOrder, Writes an unsigned n-bytes integer to the underlying writer. Read more
fn write_int<T>(&mut self, n: i64, nbytes: usize) -> Result<(), Error> where
T: ByteOrder,
fn write_int<T>(&mut self, n: i64, nbytes: usize) -> Result<(), Error> where
T: ByteOrder, Writes a signed n-bytes integer to the underlying writer. Read more
fn write_f32<T>(&mut self, n: f32) -> Result<(), Error> where
T: ByteOrder,
fn write_f32<T>(&mut self, n: f32) -> Result<(), Error> where
T: ByteOrder, Writes a IEEE754 single-precision (4 bytes) floating point number to the underlying writer. Read more
fn write_f64<T>(&mut self, n: f64) -> Result<(), Error> where
T: ByteOrder,
fn write_f64<T>(&mut self, n: f64) -> Result<(), Error> where
T: ByteOrder, Writes a IEEE754 double-precision (8 bytes) floating point number to the underlying writer. Read more