pub struct ChannelPolicyConfig { /* private fields */ }Expand description
Ordered pressure escalation policy for a channel.
Implementations§
Source§impl ChannelPolicyConfig
impl ChannelPolicyConfig
Sourcepub fn new(policies: Vec<PressurePolicy>) -> Self
pub fn new(policies: Vec<PressurePolicy>) -> Self
Creates a channel policy configuration ordered by ascending threshold.
Sourcepub fn policies(&self) -> &[PressurePolicy]
pub fn policies(&self) -> &[PressurePolicy]
Returns the configured pressure policies in escalation order.
Sourcepub fn is_empty(&self) -> bool
pub fn is_empty(&self) -> bool
Returns whether this channel has no configured pressure policies.
Sourcepub fn len(&self) -> usize
pub fn len(&self) -> usize
Returns the number of configured pressure policies for this channel.
Sourcepub fn actions_for_pressure(&self, pressure: f64) -> Vec<PolicyAction>
pub fn actions_for_pressure(&self, pressure: f64) -> Vec<PolicyAction>
Returns every action active for the supplied channel pressure score.
Trait Implementations§
Source§impl Clone for ChannelPolicyConfig
impl Clone for ChannelPolicyConfig
Source§fn clone(&self) -> ChannelPolicyConfig
fn clone(&self) -> ChannelPolicyConfig
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 ChannelPolicyConfig
impl Debug for ChannelPolicyConfig
Source§impl Default for ChannelPolicyConfig
impl Default for ChannelPolicyConfig
Source§fn default() -> ChannelPolicyConfig
fn default() -> ChannelPolicyConfig
Returns the “default value” for a type. Read more
Source§impl PartialEq for ChannelPolicyConfig
impl PartialEq for ChannelPolicyConfig
Source§fn eq(&self, other: &ChannelPolicyConfig) -> bool
fn eq(&self, other: &ChannelPolicyConfig) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for ChannelPolicyConfig
Auto Trait Implementations§
impl Freeze for ChannelPolicyConfig
impl RefUnwindSafe for ChannelPolicyConfig
impl Send for ChannelPolicyConfig
impl Sync for ChannelPolicyConfig
impl Unpin for ChannelPolicyConfig
impl UnsafeUnpin for ChannelPolicyConfig
impl UnwindSafe for ChannelPolicyConfig
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