/// Returns the schema for a given selection
///
/// If Selection::All the returned columns are sorted by name
Returns the schema for a given selection
If Selection::All the returned columns are sorted by name
Returns the schema for a given selection If Selection :: All the returned columns are sorted by name
pub fn schema(&self, selection: Selection<'_>) -> Result<Schema> {
        let mut schema_builder = SchemaBuilder::new();
        let schema = match selection {
            Selection::All => {
                for (column_name, column) in self.columns.iter() {
                    schema_builder.influx_column(column_name, column.influx_type());
                }
                schema_builder
                    .build()
                    .context(InternalSchema)?
                    .sort_fields_by_name()
            }
            Selection::Some(cols) => {
                for col in cols {
                    let column = self.column(col)?;
                    schema_builder.influx_column(col, column.influx_type());
                }
                schema_builder.build().context(InternalSchema)?
            }
        };
        Ok(schema)
    }
pub fn schema ( & self , selection : Selection < ' _ > ) -> Result < Schema > { let mut schema_builder = SchemaBuilder :: new ( ) ; let schema = match selection { Selection :: All => { for ( column_name , column ) in self . columns . iter ( ) { schema_builder . influx_column ( column_name , column . influx_type ( ) ) ; } schema_builder . build ( ) . context ( InternalSchema ) ? . sort_fields_by_name ( ) } Selection :: Some ( cols ) => { for col in cols { let column = self . column ( col ) ? ; schema_builder . influx_column ( col , column . influx_type ( ) ) ; } schema_builder . build ( ) . context ( InternalSchema ) ? } } ; Ok ( schema ) }
Returns the schema for a given selection
If Selection::All the returned columns are sorted by name
Returns the schema for a given selection If Selection :: All the returned columns are sorted by name
&self
selection
Selection<'_>