pub struct AdaptationRule { /* private fields */ }Expand description
Declarative mapping from an outcome and optional evidence expression to a directive.
Implementations§
Source§impl AdaptationRule
impl AdaptationRule
Sourcepub fn new(
id: impl Into<String>,
selector: OutcomeSelector,
priority: u16,
condition: Option<Expression>,
directive: PipelineDirective,
rationale: impl Into<String>,
max_applications: u16,
) -> Result<Self, AdaptivePipelineError>
pub fn new( id: impl Into<String>, selector: OutcomeSelector, priority: u16, condition: Option<Expression>, directive: PipelineDirective, rationale: impl Into<String>, max_applications: u16, ) -> Result<Self, AdaptivePipelineError>
Creates a validated adaptation rule.
Sourcepub fn selector(&self) -> &OutcomeSelector
pub fn selector(&self) -> &OutcomeSelector
Returns the accepted outcome selector.
Sourcepub fn condition(&self) -> Option<&Expression>
pub fn condition(&self) -> Option<&Expression>
Returns the optional evidence condition.
Sourcepub fn directive(&self) -> &PipelineDirective
pub fn directive(&self) -> &PipelineDirective
Returns the emitted directive template.
Sourcepub fn max_applications(&self) -> u16
pub fn max_applications(&self) -> u16
Returns the maximum number of times this rule may win in one ledger.
Trait Implementations§
Source§impl Clone for AdaptationRule
impl Clone for AdaptationRule
Source§fn clone(&self) -> AdaptationRule
fn clone(&self) -> AdaptationRule
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 Debug for AdaptationRule
impl Debug for AdaptationRule
Source§impl<'de> Deserialize<'de> for AdaptationRule
impl<'de> Deserialize<'de> for AdaptationRule
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
impl Eq for AdaptationRule
Source§impl PartialEq for AdaptationRule
impl PartialEq for AdaptationRule
Source§impl Serialize for AdaptationRule
impl Serialize for AdaptationRule
impl StructuralPartialEq for AdaptationRule
Auto Trait Implementations§
impl Freeze for AdaptationRule
impl RefUnwindSafe for AdaptationRule
impl Send for AdaptationRule
impl Sync for AdaptationRule
impl Unpin for AdaptationRule
impl UnsafeUnpin for AdaptationRule
impl UnwindSafe for AdaptationRule
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more