Trait mz_sql::session::vars::polyfill::LazyValueFn

source ·
pub trait LazyValueFn<V: Value>: Copy {
    const LAZY_VALUE_FN: fn() -> &'static dyn Value = _;

    // Required method
    fn generate_value() -> &'static V;
}
Expand description

Trait that helps us convert a fn() -> &'static impl Value to a fn() -> &'static dyn Value.

For creating a type that implements LazyValueFn see the lazy_value macro.

Note: Ideally we could use const generics to pass a function pointer directly to VarDefinition::new, but Rust doesn’t currently support this.

Provided Associated Constants§

source

const LAZY_VALUE_FN: fn() -> &'static dyn Value = _

Required Methods§

Object Safety§

This trait is not object safe.

Implementors§