struct
Spec
pub struct Spec {
pub src: String,
pub format: Option<Format>,
pub path: Option<String>,
pub query: Option<String>,
pub variables: Option<Value>,
pub method: Option<String>,
pub body: Option<String>,
pub params: Option<Value>,
pub load: Option<Load>,
pub refresh: Option<f64>,
pub missing: Vec<String>,
pub filter: Option<BTreeMap<String, Value>>,
pub sort: Option<String>,
pub limit: Option<usize>,
pub group_by: Option<String>,
pub group_within: Vec<String>,
pub aggregate: Option<String>,
pub live: Option<String>,
pub live_path: Option<String>,
pub event: Option<String>,
pub subscription: Option<String>,
pub update: Option<Update>,
pub row_key: Option<String>,
pub keep: Option<usize>,
pub preset: Option<String>,
pub skip: Option<String>,
pub header_rows: Option<usize>,
pub footer: Option<usize>,
pub sheet: Option<String>,
pub melt: Option<Vec<String>>,
pub labels: Option<String>,
pub paginate: bool,
}What a component's src and related props ask for.
Fields
group_within
pub group_within: Vec<String>Columns a group_by keeps apart: what the chart splits on anyway.
live
pub live: Option<String>Where updates arrive: wss:// is a WebSocket, anything else server-sent events.
update
pub update: Option<Update>What a live update does to the rows: replace them, append, or upsert.
melt
pub melt: Option<Vec<String>>Columns to turn into variable and value rows: true for every number column.
Methods
from_props
pub fn from_props(get: impl Fn(&str) -> Option<Value>) -> Option<Spec>Read the props (None when there's no src).
key
pub fn key(&self) -> StringIdentifies the request, so components asking for the same data share one load (shaping happens per component).
fetches
pub fn fetches(&self) -> boolWhether there's anything to load before updates start. A subscription's src is only where to connect, unless a query gives it a first load.
stats_option
pub fn stats_option(&self) -> Option<&'static str>A set option that needs the stats feature.
update_mode
pub fn update_mode(&self) -> UpdateHow a live message applies: upsert given a key, else append.
problem
pub fn problem(&self) -> Option<String>A mistake in the props that would send the wrong request, said in a way that fixes it. query is a GraphQL query, and a value like startPeriod=2026-06 is meant as the URL's query string: sent as GraphQL, it becomes a JSON POST that APIs reject (often as a baffling CORS error, since the JSON header needs a preflight).