pub fn try_new(
        mut writer: W,
        schema: &Schema,
        ipc_fields: Option<Vec<IpcField>>,
        options: WriteOptions,
    ) -> Result<Self> {
        // write magic to header
        writer.write_all(&ARROW_MAGIC[..])?;
        // create an 8-byte boundary after the header
        writer.write_all(&[0, 0])?;
        // write the schema, set the written bytes to the schema

        let ipc_fields = if let Some(ipc_fields) = ipc_fields {
            ipc_fields
        } else {
            default_ipc_fields(&schema.fields)
        };
        let encoded_message = EncodedData {
            ipc_message: schema_to_bytes(schema, &ipc_fields),
            arrow_data: vec![],
        };

        let (meta, data) = write_message(&mut writer, encoded_message)?;
        Ok(Self {
            writer,
            options,
            schema: schema.clone(),
            ipc_fields,
            block_offsets: meta + data + 8,
            dictionary_blocks: vec![],
            record_blocks: vec![],
            finished: false,
            dictionary_tracker: DictionaryTracker::new(true),
        })
    }
/// Try create a new writer, with the schema written as part of the header
Try create a new writer, with the schema written as part of the header
Try create a new writer with the schema written as part of the header
pub fn try_new(
        mut writer: W,
        schema: &Schema,
        ipc_fields: Option<Vec<IpcField>>,
        options: WriteOptions,
    ) -> Result<Self> {
        // write magic to header
        writer.write_all(&ARROW_MAGIC[..])?;
        // create an 8-byte boundary after the header
        writer.write_all(&[0, 0])?;
        // write the schema, set the written bytes to the schema
        let ipc_fields = if let Some(ipc_fields) = ipc_fields {
            ipc_fields
        } else {
            default_ipc_fields(&schema.fields)
        };
        let encoded_message = EncodedData {
            ipc_message: schema_to_bytes(schema, &ipc_fields),
            arrow_data: vec![],
        };
        let (meta, data) = write_message(&mut writer, encoded_message)?;
        Ok(Self {
            writer,
            options,
            schema: schema.clone(),
            ipc_fields,
            block_offsets: meta + data + 8,
            dictionary_blocks: vec![],
            record_blocks: vec![],
            finished: false,
            dictionary_tracker: DictionaryTracker::new(true),
        })
    }
pub fn try_new ( mut writer : W , schema : & Schema , ipc_fields : Option < Vec < IpcField > > , options : WriteOptions , ) -> Result < Self > { // write magic to header writer . write_all ( & ARROW_MAGIC [ .. ] ) ? ; // create an 8-byte boundary after the header writer . write_all ( & [ 0 , 0 ] ) ? ; // write the schema, set the written bytes to the schema let ipc_fields = if let Some ( ipc_fields ) = ipc_fields { ipc_fields } else { default_ipc_fields ( & schema . fields ) } ; let encoded_message = EncodedData { ipc_message : schema_to_bytes ( schema , & ipc_fields ) , arrow_data : vec ! [ ] , } ; let ( meta , data ) = write_message ( & mut writer , encoded_message ) ? ; Ok ( Self { writer , options , schema : schema . clone ( ) , ipc_fields , block_offsets : meta + data + 8 , dictionary_blocks : vec ! [ ] , record_blocks : vec ! [ ] , finished : false , dictionary_tracker : DictionaryTracker :: new ( true ) , } ) }
Try create a new writer, with the schema written as part of the header
Try create a new writer with the schema written as part of the header
writer
W
schema
&Schema
ipc_fields
Option<Vec<IpcField>>
options
WriteOptions
writer
W
schema
&Schema
ipc_fields
Option<Vec<IpcField>>
options
WriteOptions