Enum QueryData

Source
pub enum QueryData {
    NoHeaders {
        rows: Vec<Vec<Value>>,
    },
    WithNames {
        names: Vec<String>,
        rows: Vec<Vec<Value>>,
    },
    WithNamesAndTypes {
        names_and_types: Vec<(String, Type)>,
        rows: Vec<Vec<Value>>,
    },
}
Expand description

Query data

Variants§

§

NoHeaders

Without headers

Fields

§rows: Vec<Vec<Value>>

Rows

§

WithNames

With columnn names

Fields

§names: Vec<String>

Column names

§rows: Vec<Vec<Value>>

Rows

§

WithNamesAndTypes

With columnn names and types

Fields

§names_and_types: Vec<(String, Type)>

Column names and types

§rows: Vec<Vec<Value>>

Rows

Implementations§

Source§

impl QueryData

Source

pub fn no_headers() -> Self

Creates a new [QueryTable] witout headers

Source

pub fn with_names(names: Vec<&str>) -> Self

Creates a new [QueryTable] with column names

Source

pub fn with_names_and_types(names_and_types: Vec<(&str, Type)>) -> Self

Creates a new [QueryTable] with column names and types

Source

pub fn from_schema(schema: &TableSchema) -> Self

Creates a new [QueryTable] from a TableSchema

Source

pub fn row(self, row: Vec<Value>) -> Self

Adds a row

Source

pub fn rows(self, rows: Vec<Vec<Value>>) -> Self

Adds several rows

Source

pub fn add_row(&mut self, row: Vec<Value>) -> &mut Self

Adds a row

Source

pub fn add_rows(&mut self, rows: Vec<Vec<Value>>) -> &mut Self

Adds rows

Source

pub fn get_rows(&self) -> &Vec<Vec<Value>>

Returns a reference to the rows

Source

pub fn get_rows_mut(&mut self) -> &mut Vec<Vec<Value>>

Returns a mut reference to the rows

Source

pub fn n_rows(&self) -> usize

Returns the number of rows

Source

pub fn get_columns(&self) -> Option<Vec<(&str, Option<Type>)>>

Gets a reference to the columns

Source

pub fn n_cols(&self) -> usize

Returns the number of columns

Source

pub fn get_names_and_types(&self) -> Option<Vec<(&str, Type)>>

Gets a reference to the column names and types

Source

pub fn get_types(&self) -> Option<Vec<Type>>

Gets a reference to the column types

Source

pub fn into_parts(self) -> QueryDataParts

Extracts the parts

Source§

impl QueryData

Source

pub fn to_bytes(self, format: Format) -> Result<Vec<u8>, Error>

Converts to bytes

Source

pub fn from_bytes( bytes: &[u8], format: Format, mapping: Option<&[(&str, Type)]>, ) -> Result<Self, Error>

Parses from bytes

Trait Implementations§

Source§

impl Clone for QueryData

Source§

fn clone(&self) -> QueryData

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for QueryData

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for QueryData

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Display for QueryData

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl PartialEq for QueryData

Source§

fn eq(&self, other: &QueryData) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for QueryData

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

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

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

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

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more