Skip to main content

MySQLRowAccess

Trait MySQLRowAccess 

Source
pub trait MySQLRowAccess {
    // Required method
    fn value_at(
        &self,
        offset: usize,
    ) -> Result<Option<MySQLValue<'_>>, DrizzleError>;

    // Provided method
    fn is_bit_at(&self, _offset: usize) -> bool { ... }
}
Expand description

A driver row whose cells can be read as MySQLValues.

Implemented for [OwnedMySQLValue], Vec<OwnedMySQLValue>, [MySQLValue], and (with mysql-common) mysql_common::Row. Implementations must return Ok(None) for a missing or already consumed cell, and must not panic on a bad offset or conversion.

Required Methods§

Source

fn value_at( &self, offset: usize, ) -> Result<Option<MySQLValue<'_>>, DrizzleError>

Returns the cell at offset (0-based), or None if there is none.

§Errors

Returns an error when the driver cannot read the row.

Provided Methods§

Source

fn is_bit_at(&self, _offset: usize) -> bool

Returns whether the cell at offset is a BIT column, whose bytes are a packed big-endian number.

The default is false. Drivers override it from their column metadata, so integer and bool decoders read BIT bytes as a number while byte decoders keep them as bytes.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl MySQLRowAccess for Vec<OwnedMySQLValue>

Source§

fn value_at( &self, offset: usize, ) -> Result<Option<MySQLValue<'_>>, DrizzleError>

Source§

impl MySQLRowAccess for [MySQLValue<'_>]

Source§

fn value_at( &self, offset: usize, ) -> Result<Option<MySQLValue<'_>>, DrizzleError>

Source§

impl MySQLRowAccess for [OwnedMySQLValue]

Source§

fn value_at( &self, offset: usize, ) -> Result<Option<MySQLValue<'_>>, DrizzleError>

Implementors§