nominal-api-conjure 0.1426.0

Conjure HTTP API bindings for the Nominal platform
Documentation
/// A flowing layout where order is the data: cells render in list order and
/// wrap onto a new line every `wrapWidth` cells. A cell's position is its
/// index — there are no coordinates and no row or column counts.
///
/// Deliberately has no `rowConfigs`: rows are derived wrap lines, so a
/// persisted per-row config would be silently mis-targeted whenever
/// `wrapWidth` or a fan-out's cardinality changed. Do not add one for symmetry.
#[derive(
    Debug,
    Clone,
    conjure_object::serde::Serialize,
    conjure_object::serde::Deserialize,
    conjure_object::private::DeriveWith
)]
#[serde(crate = "conjure_object::serde")]
#[derive_with(PartialEq, Eq, PartialOrd, Ord, Hash)]
#[conjure_object::private::staged_builder::staged_builder]
#[builder(crate = conjure_object::private::staged_builder, update, inline)]
pub struct ValueTableLayoutFlow {
    #[builder(default, list(item(type = super::ValueTableFlowCell)))]
    #[serde(rename = "cells", skip_serializing_if = "Vec::is_empty", default)]
    cells: Vec<super::ValueTableFlowCell>,
    #[serde(rename = "wrapWidth")]
    wrap_width: i32,
    #[builder(default, list(item(type = super::ValueTableGridRowColumnConfig)))]
    #[serde(rename = "columnConfigs", skip_serializing_if = "Vec::is_empty", default)]
    column_configs: Vec<super::ValueTableGridRowColumnConfig>,
    #[builder(
        default,
        map(key(type = String, into), value(type = super::ValueTableMultiCellConfig))
    )]
    #[serde(
        rename = "groups",
        skip_serializing_if = "std::collections::BTreeMap::is_empty",
        default
    )]
    groups: std::collections::BTreeMap<String, super::ValueTableMultiCellConfig>,
}
impl ValueTableLayoutFlow {
    /// Constructs a new instance of the type.
    #[inline]
    pub fn new(wrap_width: i32) -> Self {
        Self::builder().wrap_width(wrap_width).build()
    }
    /// The cells to display, in render order.
    #[inline]
    pub fn cells(&self) -> &[super::ValueTableFlowCell] {
        &*self.cells
    }
    /// The number of cells per wrap line, and therefore the flow's column count.
    /// Never infer that count from `columnConfigs`, which is sparse: `[]` means
    /// `wrapWidth` columns none of which are configured, not zero columns.
    #[inline]
    pub fn wrap_width(&self) -> i32 {
        self.wrap_width
    }
    /// Column-level configurations, sparse over the `wrapWidth` columns: a column
    /// with no header and no cell config has no entry. `position` is authoritative
    /// rather than the array index, and must be less than `wrapWidth`. The
    /// count-plus-configs pairing mirrors `ValueTableLayoutGrid`'s `columnCount`,
    /// though that arm's list is written densely.
    #[inline]
    pub fn column_configs(&self) -> &[super::ValueTableGridRowColumnConfig] {
        &*self.column_configs
    }
    /// Per-group cell configuration, keyed by `ValueTableFlowCell.groupId`. A
    /// group with no entry falls back to `gridDefaultCellConfigs`; entries with
    /// no matching cell are tolerated.
    #[inline]
    pub fn groups(
        &self,
    ) -> &std::collections::BTreeMap<String, super::ValueTableMultiCellConfig> {
        &self.groups
    }
}