Skip to main content

IntoEngineData

Trait IntoEngineData 

Source
pub trait IntoEngineData {
    // Required method
    fn into_engine_data(
        self,
        schema: SchemaRef,
        engine: &dyn Engine,
    ) -> DeltaResult<Box<dyn EngineData>>;
}
Available on crate feature internal-api only.
Expand description

A trait that allows converting a type into (single-row) EngineData

This is typically used with the #[derive(IntoEngineData)] macro which leverages the traits ToDataType and Into<Scalar> for struct fields to convert a struct into EngineData.

§Example


#[derive(Schema, IntoEngineData)]
struct MyStruct {
   a: i32,
   b: String,
}

let my_struct = MyStruct { a: 42, b: "Hello".to_string() };
// typically used with ToSchema
let schema = Arc::new(MyStruct::to_schema());
// single-row EngineData
let engine = todo!(); // create an engine
let engine_data = my_struct.into_engine_data(schema, engine);

Required Methods§

Source

fn into_engine_data( self, schema: SchemaRef, engine: &dyn Engine, ) -> DeltaResult<Box<dyn EngineData>>

Consume this type to produce a single-row EngineData using the provided schema.

Implementors§