Struct arrow::ipc::writer::StreamWriter[][src]

pub struct StreamWriter<W: Write> { /* fields omitted */ }

Implementations

impl<W: Write> StreamWriter<W>[src]

pub fn try_new(writer: W, schema: &Schema) -> Result<Self>[src]

Try create a new writer, with the schema written as part of the header

pub fn try_new_with_options(
    writer: W,
    schema: &Schema,
    write_options: IpcWriteOptions
) -> Result<Self>
[src]

pub fn write(&mut self, batch: &RecordBatch) -> Result<()>[src]

Write a record batch to the stream

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

Write continuation bytes, and mark the stream as done

pub fn into_inner(self) -> Result<W>[src]

Unwraps the BufWriter housed in StreamWriter.writer, returning the underlying writer

The buffer is flushed and the StreamWriter is finished before returning the writer.

Errors

An [‘Err’] may be returned if an error occurs while finishing the StreamWriter or while flushing the buffer.

Example

// The result we expect from an empty schema
let expected = vec![
    255, 255, 255, 255,  64,   0,   0,   0,
     16,   0,   0,   0,   0,   0,  10,   0,
     14,   0,  12,   0,  11,   0,   4,   0,
     10,   0,   0,   0,  20,   0,   0,   0,
      0,   0,   0,   1,   4,   0,  10,   0,
     12,   0,   0,   0,   8,   0,   4,   0,
     10,   0,   0,   0,   8,   0,   0,   0,
      8,   0,   0,   0,   0,   0,   0,   0,
      0,   0,   0,   0,   0,   0,   0,   0,
    255, 255, 255, 255,   0,   0,   0,   0
];

let schema = Schema::new(vec![]);
let buffer: Vec<u8> = Vec::new();
let stream_writer = StreamWriter::try_new(buffer, &schema)?;

assert_eq!(stream_writer.into_inner()?, expected);

Auto Trait Implementations

impl<W> !RefUnwindSafe for StreamWriter<W>

impl<W> Send for StreamWriter<W> where
    W: Send

impl<W> Sync for StreamWriter<W> where
    W: Sync

impl<W> Unpin for StreamWriter<W> where
    W: Unpin

impl<W> !UnwindSafe for StreamWriter<W>

Blanket Implementations

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

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

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

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

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

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

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

pub fn from(t: T) -> T[src]

Performs the conversion.

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

pub fn into(self) -> U[src]

Performs the conversion.

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.

pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]

Performs the conversion.

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.

pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]

Performs the conversion.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>, 

pub fn vzip(self) -> V