Trait RowMetadata

Source
pub trait RowMetadata {
    // Required methods
    fn get_column_metadata(index: i32) -> Result<Box<dyn ColumnMetadata>>;
    fn get_column_metadata_by_name<S: Into<String>>(
        name: S,
    ) -> Result<Box<dyn ColumnMetadata>>;
    fn get_column_metadatas() -> Vec<Box<dyn ColumnMetadata>>;
    fn contains<S: Into<String>>(column_name: S) -> bool;
}
Expand description

Represents the metadata for a row of the results returned from a query. Metadata for columns can be either retrieved by specifying a column name or the column index. Columns indexes are 0-based. Column names do not necessarily reflect the column names how they are in the underlying tables but rather how columns are represented (e.g. aliased) in the result.

Required Methods§

Source

fn get_column_metadata(index: i32) -> Result<Box<dyn ColumnMetadata>>

Returns the ColumnMetadata for one column in this row.

Arguments:

  • index: the column index starting at 0

return the ColumnMetadata for one column in this row return index out of bounds error if [index] is out of range (negative or equals/exceeds [getColumnMetadatas().len()]

Source

fn get_column_metadata_by_name<S: Into<String>>( name: S, ) -> Result<Box<dyn ColumnMetadata>>

Returns the ColumnMetadata for one column in this row.

Arguments:

  • name: the name of the column. Column names are case insensitive. When a get method contains several columns with same name, then the value of the first matching column will be returned.

return the ColumnMetadata for one column in this row returns illegal argument error if [name] empty returns no such element if there is no column with the [name] NoSuchElementException if there is no column with the {@code name}

Source

fn get_column_metadatas() -> Vec<Box<dyn ColumnMetadata>>

Returns the ColumnMetadata for all columns in this row.

Source

fn contains<S: Into<String>>(column_name: S) -> bool

Returns whether this object contains metadata for [column_name]. Lookups are case-insensitive. Implementations may allow escape characters to enforce a particular mode of comparison when querying for presence/absence of a column.

return true if this object contains metadata for [column_name]; false otherwise.

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.

Implementors§