Trait EncodeToRecordBatch

Source
pub trait EncodeToRecordBatch
where Self: Sized + ArrowSchemaProvider,
{ // Required methods fn encode_batch( metadata: &HashMap<String, String>, data: &[Self], ) -> Result<RecordBatch, ArrowError>; fn metadata(&self) -> HashMap<String, String>; // Provided method fn chunk_metadata(chunk: &[Self]) -> HashMap<String, String> { ... } }

Required Methods§

Source

fn encode_batch( metadata: &HashMap<String, String>, data: &[Self], ) -> Result<RecordBatch, ArrowError>

Encodes a batch of values into an Arrow RecordBatch using the provided metadata.

§Errors

Returns an ArrowError if the encoding fails.

Source

fn metadata(&self) -> HashMap<String, String>

Provided Methods§

Source

fn chunk_metadata(chunk: &[Self]) -> HashMap<String, String>

Returns the metadata for the first element in a chunk.

§Panics

Panics if chunk is empty.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl EncodeToRecordBatch for Bar

Source§

fn encode_batch( metadata: &HashMap<String, String>, data: &[Self], ) -> Result<RecordBatch, ArrowError>

Source§

fn metadata(&self) -> HashMap<String, String>

Source§

impl EncodeToRecordBatch for IndexPriceUpdate

Source§

fn encode_batch( metadata: &HashMap<String, String>, data: &[Self], ) -> Result<RecordBatch, ArrowError>

Source§

fn metadata(&self) -> HashMap<String, String>

Source§

impl EncodeToRecordBatch for InstrumentClose

Source§

fn encode_batch( metadata: &HashMap<String, String>, data: &[Self], ) -> Result<RecordBatch, ArrowError>

Source§

fn metadata(&self) -> HashMap<String, String>

Source§

impl EncodeToRecordBatch for MarkPriceUpdate

Source§

fn encode_batch( metadata: &HashMap<String, String>, data: &[Self], ) -> Result<RecordBatch, ArrowError>

Source§

fn metadata(&self) -> HashMap<String, String>

Source§

impl EncodeToRecordBatch for OrderBookDelta

Source§

fn chunk_metadata(chunk: &[Self]) -> HashMap<String, String>

Extract metadata from first two deltas

Use the second delta if the first one has 0 precision

Source§

fn encode_batch( metadata: &HashMap<String, String>, data: &[Self], ) -> Result<RecordBatch, ArrowError>

Source§

fn metadata(&self) -> HashMap<String, String>

Source§

impl EncodeToRecordBatch for OrderBookDepth10

Source§

fn encode_batch( metadata: &HashMap<String, String>, data: &[Self], ) -> Result<RecordBatch, ArrowError>

Source§

fn metadata(&self) -> HashMap<String, String>

Source§

impl EncodeToRecordBatch for QuoteTick

Source§

fn encode_batch( metadata: &HashMap<String, String>, data: &[Self], ) -> Result<RecordBatch, ArrowError>

Source§

fn metadata(&self) -> HashMap<String, String>

Source§

impl EncodeToRecordBatch for TradeTick

Source§

fn encode_batch( metadata: &HashMap<String, String>, data: &[Self], ) -> Result<RecordBatch, ArrowError>

Source§

fn metadata(&self) -> HashMap<String, String>

Implementors§