pub struct NodeRepeatableCollectionDescriptor {Show 13 fields
pub key: String,
pub item_source: String,
pub item_id_path: String,
pub item_template_slots: Vec<NodeSurfaceSlotDescriptor>,
pub label: Option<String>,
pub empty_label: Option<String>,
pub min_items: Option<usize>,
pub max_items: Option<usize>,
pub reorderable: bool,
pub add_action: Option<String>,
pub remove_action: Option<String>,
pub reorder_action: Option<String>,
pub anchor_rule: NodeRepeatableAnchorRule,
}Expand description
Descriptor for node data arrays or maps rendered as stable dynamic rows.
Fields§
§key: String§item_source: String§item_id_path: String§item_template_slots: Vec<NodeSurfaceSlotDescriptor>§label: Option<String>§empty_label: Option<String>§min_items: Option<usize>§max_items: Option<usize>§reorderable: bool§add_action: Option<String>§remove_action: Option<String>§reorder_action: Option<String>§anchor_rule: NodeRepeatableAnchorRuleImplementations§
Source§impl NodeRepeatableCollectionDescriptor
impl NodeRepeatableCollectionDescriptor
pub fn new( key: impl Into<String>, item_source: impl Into<String>, item_id_path: impl Into<String>, ) -> Self
pub fn with_label(self, label: impl Into<String>) -> Self
pub fn with_empty_label(self, empty_label: impl Into<String>) -> Self
pub fn with_item_template_slot(self, slot: NodeSurfaceSlotDescriptor) -> Self
pub fn with_item_template_slots( self, slots: impl IntoIterator<Item = NodeSurfaceSlotDescriptor>, ) -> Self
pub fn with_min_items(self, min_items: usize) -> Self
pub fn with_max_items(self, max_items: usize) -> Self
pub fn reorderable(self) -> Self
pub fn with_add_action(self, action: impl Into<String>) -> Self
pub fn with_remove_action(self, action: impl Into<String>) -> Self
pub fn with_reorder_action(self, action: impl Into<String>) -> Self
pub fn with_anchor_rule(self, anchor_rule: NodeRepeatableAnchorRule) -> Self
pub fn item_projections( &self, node_data: &Value, ) -> Vec<NodeRepeatableItemProjection>
pub fn is_empty_for(&self, node_data: &Value) -> bool
pub fn add_disabled_reason(&self, node_data: &Value) -> Option<String>
pub fn remove_disabled_reason(&self, node_data: &Value) -> Option<String>
Trait Implementations§
Source§impl Clone for NodeRepeatableCollectionDescriptor
impl Clone for NodeRepeatableCollectionDescriptor
Source§fn clone(&self) -> NodeRepeatableCollectionDescriptor
fn clone(&self) -> NodeRepeatableCollectionDescriptor
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<'de> Deserialize<'de> for NodeRepeatableCollectionDescriptor
impl<'de> Deserialize<'de> for NodeRepeatableCollectionDescriptor
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for NodeRepeatableCollectionDescriptor
impl PartialEq for NodeRepeatableCollectionDescriptor
Source§fn eq(&self, other: &NodeRepeatableCollectionDescriptor) -> bool
fn eq(&self, other: &NodeRepeatableCollectionDescriptor) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for NodeRepeatableCollectionDescriptor
Auto Trait Implementations§
impl Freeze for NodeRepeatableCollectionDescriptor
impl RefUnwindSafe for NodeRepeatableCollectionDescriptor
impl Send for NodeRepeatableCollectionDescriptor
impl Sync for NodeRepeatableCollectionDescriptor
impl Unpin for NodeRepeatableCollectionDescriptor
impl UnsafeUnpin for NodeRepeatableCollectionDescriptor
impl UnwindSafe for NodeRepeatableCollectionDescriptor
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more