Skip to main content

NullProbeRow

Trait NullProbeRow 

Source
pub trait NullProbeRow<Row: ?Sized>: FromDrizzleRow<Row> {
    // Required method
    fn is_null_at(row: &Row, offset: usize) -> Result<bool, DrizzleError>;
}
Expand description

A multi-column row type that can check whether it is absent (NULL).

This makes Option<T> work as a FromDrizzleRow target for a model, as in a LEFT JOIN where the joined table may have no matching row.

The table macros implement this for each select model. Single-column types (i32, String, …) have their own Option<T> impls instead.

Required Methods§

Source

fn is_null_at(row: &Row, offset: usize) -> Result<bool, DrizzleError>

Returns true if the column at offset is NULL.

§Errors

Returns an error if the row cannot be inspected at offset (e.g. the driver reports an out-of-range index or conversion failure).

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§