pub struct SelectionParameter {
pub name: ParameterName,
pub domain: SelectionDomain,
pub constraints: Vec<SelectionConstraint>,
pub default: Option<IndexSet<SelectionItem>>,
pub labels: Labels,
pub tags: Tags,
}Expand description
A parameter whose value is an ordered multi-item selection.
Fields§
§name: ParameterNameParameter name.
domain: SelectionDomainValue domain (inline values or an external resolver).
constraints: Vec<SelectionConstraint>Registered constraints.
default: Option<IndexSet<SelectionItem>>Optional default selection (must be a subset of the domain).
labels: LabelsIntrinsic facts.
Organisational tags.
Implementations§
Source§impl SelectionParameter
impl SelectionParameter
Sourcepub fn of(
name: ParameterName,
values: IndexSet<SelectionItem>,
max_selections: u32,
) -> Result<Self>
pub fn of( name: ParameterName, values: IndexSet<SelectionItem>, max_selections: u32, ) -> Result<Self>
Construct a parameter backed by an inline value set.
Sourcepub fn external(
name: ParameterName,
resolver: ResolverId,
max_selections: u32,
) -> Result<Self>
pub fn external( name: ParameterName, resolver: ResolverId, max_selections: u32, ) -> Result<Self>
Construct a parameter backed by an external resolver.
Sourcepub fn with_default(self, default: IndexSet<SelectionItem>) -> Result<Self>
pub fn with_default(self, default: IndexSet<SelectionItem>) -> Result<Self>
Set the default selection.
Sourcepub fn with_constraint(self, c: SelectionConstraint) -> Self
pub fn with_constraint(self, c: SelectionConstraint) -> Self
Append a constraint.
Sourcepub fn with_label(self, key: LabelKey, value: LabelValue) -> Result<Self>
pub fn with_label(self, key: LabelKey, value: LabelValue) -> Result<Self>
Add a label.
Trait Implementations§
Source§impl Attributed for SelectionParameter
impl Attributed for SelectionParameter
Source§impl Clone for SelectionParameter
impl Clone for SelectionParameter
Source§fn clone(&self) -> SelectionParameter
fn clone(&self) -> SelectionParameter
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for SelectionParameter
impl Debug for SelectionParameter
Source§impl<'de> Deserialize<'de> for SelectionParameter
impl<'de> Deserialize<'de> for SelectionParameter
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 SelectionParameter
impl PartialEq for SelectionParameter
Source§impl Serialize for SelectionParameter
impl Serialize for SelectionParameter
impl Eq for SelectionParameter
impl StructuralPartialEq for SelectionParameter
Auto Trait Implementations§
impl Freeze for SelectionParameter
impl RefUnwindSafe for SelectionParameter
impl Send for SelectionParameter
impl Sync for SelectionParameter
impl Unpin for SelectionParameter
impl UnsafeUnpin for SelectionParameter
impl UnwindSafe for SelectionParameter
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.