Skip to main content

JetroSchema

Trait JetroSchema 

Source
pub trait JetroSchema {
    const EXPRS: &'static [(&'static str, &'static str)];

    // Required methods
    fn exprs() -> &'static [(&'static str, &'static str)];
    fn names() -> &'static [&'static str];
}
Expand description

Trait implemented by #[derive(JetroSchema)] — pairs a type with a fixed set of named expressions.

use jetro_core::JetroSchema;

#[derive(JetroSchema)]
#[expr(titles = "$.books.map(title)")]
#[expr(count  = "$.books.len()")]
struct BookView;

for (name, src) in BookView::exprs() { /* register on a bucket */ }

Required Associated Constants§

Source

const EXPRS: &'static [(&'static str, &'static str)]

Required Methods§

Source

fn exprs() -> &'static [(&'static str, &'static str)]

Source

fn names() -> &'static [&'static str]

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§