cratestack-core 0.4.2

Rust-native schema-first framework for typed HTTP APIs, generated clients, and backend services.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
//! Field selection / include shape used by the column-projection path.

use std::collections::BTreeMap;

use serde::{Deserialize, Serialize};

#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)]
pub struct SelectionQuery {
    pub fields: Vec<String>,
    pub includes: Vec<String>,
    pub include_fields: BTreeMap<String, Vec<String>>,
}

impl SelectionQuery {
    pub fn is_empty(&self) -> bool {
        self.fields.is_empty() && self.includes.is_empty() && self.include_fields.is_empty()
    }
}