pub struct CompositionRule {
pub id: String,
pub name: String,
pub rule_type: i32,
pub input_capabilities: Vec<i32>,
pub output_capability: Option<Capability>,
pub min_inputs: u32,
pub max_inputs: Option<u32>,
pub confidence_method: i32,
pub metadata_json: String,
pub priority: u32,
pub enabled: bool,
pub created_at: Option<Timestamp>,
}Expand description
Composition rule definition
Fields§
§id: StringUnique rule identifier
name: StringRule name
rule_type: i32Rule type
input_capabilities: Vec<i32>Input capabilities required
output_capability: Option<Capability>Output capability produced (for emergent rules)
min_inputs: u32Minimum number of inputs required
max_inputs: Option<u32>Maximum number of inputs allowed
confidence_method: i32§metadata_json: StringRule metadata (JSON-encoded for flexibility)
priority: u32Rule priority (higher = more important)
enabled: boolWhether this rule is active
created_at: Option<Timestamp>Timestamp when rule was defined
Implementations§
Source§impl CompositionRule
impl CompositionRule
Sourcepub fn rule_type(&self) -> CompositionRuleType
pub fn rule_type(&self) -> CompositionRuleType
Returns the enum value of rule_type, or the default if the field is set to an invalid enum value.
Sourcepub fn set_rule_type(&mut self, value: CompositionRuleType)
pub fn set_rule_type(&mut self, value: CompositionRuleType)
Sets rule_type to the provided enum value.
Sourcepub fn input_capabilities(
&self,
) -> FilterMap<Cloned<Iter<'_, i32>>, fn(i32) -> Option<CapabilityType>>
pub fn input_capabilities( &self, ) -> FilterMap<Cloned<Iter<'_, i32>>, fn(i32) -> Option<CapabilityType>>
Returns an iterator which yields the valid enum values contained in input_capabilities.
Sourcepub fn push_input_capabilities(&mut self, value: CapabilityType)
pub fn push_input_capabilities(&mut self, value: CapabilityType)
Appends the provided enum value to input_capabilities.
Sourcepub fn max_inputs(&self) -> u32
pub fn max_inputs(&self) -> u32
Returns the value of max_inputs, or the default value if max_inputs is unset.
Sourcepub fn confidence_method(&self) -> ConfidenceMethod
pub fn confidence_method(&self) -> ConfidenceMethod
Returns the enum value of confidence_method, or the default if the field is set to an invalid enum value.
Sourcepub fn set_confidence_method(&mut self, value: ConfidenceMethod)
pub fn set_confidence_method(&mut self, value: ConfidenceMethod)
Sets confidence_method to the provided enum value.
Trait Implementations§
Source§impl Clone for CompositionRule
impl Clone for CompositionRule
Source§fn clone(&self) -> CompositionRule
fn clone(&self) -> CompositionRule
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for CompositionRule
impl Debug for CompositionRule
Source§impl Default for CompositionRule
impl Default for CompositionRule
Source§impl<'de> Deserialize<'de> for CompositionRule
impl<'de> Deserialize<'de> for CompositionRule
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>,
Source§impl Message for CompositionRule
impl Message for CompositionRule
Source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
Source§fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
Source§fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
Source§fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
Source§fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
Source§fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
Source§fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
Source§fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self. Read moreSource§fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self.Source§impl PartialEq for CompositionRule
impl PartialEq for CompositionRule
Source§fn eq(&self, other: &CompositionRule) -> bool
fn eq(&self, other: &CompositionRule) -> bool
self and other values to be equal, and is used by ==.