pub struct PaymentPolicySet { /* private fields */ }Available on crate feature
payments only.Expand description
Ordered collection of payment policy guardrails.
Implementations§
Source§impl PaymentPolicySet
impl PaymentPolicySet
Sourcepub fn new() -> PaymentPolicySet
pub fn new() -> PaymentPolicySet
Creates an empty payment policy set.
Sourcepub fn with(
self,
guardrail: impl PaymentPolicyGuardrail + 'static,
) -> PaymentPolicySet
pub fn with( self, guardrail: impl PaymentPolicyGuardrail + 'static, ) -> PaymentPolicySet
Adds one concrete guardrail to the set.
Sourcepub fn with_arc(
self,
guardrail: Arc<dyn PaymentPolicyGuardrail>,
) -> PaymentPolicySet
pub fn with_arc( self, guardrail: Arc<dyn PaymentPolicyGuardrail>, ) -> PaymentPolicySet
Adds one shared guardrail instance to the set.
Sourcepub fn guardrails(&self) -> &[Arc<dyn PaymentPolicyGuardrail>]
pub fn guardrails(&self) -> &[Arc<dyn PaymentPolicyGuardrail>]
Returns all configured payment policy guardrails.
Sourcepub fn evaluate(
&self,
record: &TransactionRecord,
protocol: &ProtocolDescriptor,
) -> PaymentPolicyDecision
pub fn evaluate( &self, record: &TransactionRecord, protocol: &ProtocolDescriptor, ) -> PaymentPolicyDecision
Evaluates all configured guardrails and returns the strongest outcome.
Trait Implementations§
Source§impl Default for PaymentPolicySet
impl Default for PaymentPolicySet
Source§fn default() -> PaymentPolicySet
fn default() -> PaymentPolicySet
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for PaymentPolicySet
impl !RefUnwindSafe for PaymentPolicySet
impl Send for PaymentPolicySet
impl Sync for PaymentPolicySet
impl Unpin for PaymentPolicySet
impl UnsafeUnpin for PaymentPolicySet
impl !UnwindSafe for PaymentPolicySet
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