Skip to main content

OptionalQueryElement

Trait OptionalQueryElement 

Source
pub trait OptionalQueryElement: Sized {
    // Required method
    fn optional_from_view(
        view: &ViewValue,
    ) -> Result<Option<Self>, ZeroValueError>;
}
Expand description

What an Option query value holds: the row of one(), or the value of sum, avg, min or max, which is None over no rows. Generated rows implement it with optional_row, generated enumerations with optional_value.

Required Methods§

Source

fn optional_from_view(view: &ViewValue) -> Result<Option<Self>, ZeroValueError>

Reads the query’s result from its view: None for no row, or for an aggregate over no rows.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementations on Foreign Types§

Source§

impl OptionalQueryElement for String

Source§

impl OptionalQueryElement for bool

Source§

impl OptionalQueryElement for f64

Source§

impl OptionalQueryElement for i64

Implementors§