pub enum ShieldValuePolicy {
PreserveValue,
PreserveRatio,
}Expand description
Explicit charge policy for Shield::reconfigure.
Variants§
PreserveValue
Keep absolute charge, clamping to the new maximum on shrink. Never heal on growth.
PreserveRatio
Scale the old fraction using f64 intermediates, then round to f32 and cap at the new maximum. An old maximum of zero has fraction zero.
Trait Implementations§
Source§impl Clone for ShieldValuePolicy
impl Clone for ShieldValuePolicy
Source§fn clone(&self) -> ShieldValuePolicy
fn clone(&self) -> ShieldValuePolicy
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 ShieldValuePolicy
impl Debug for ShieldValuePolicy
Source§impl PartialEq for ShieldValuePolicy
impl PartialEq for ShieldValuePolicy
impl Copy for ShieldValuePolicy
impl Eq for ShieldValuePolicy
impl StructuralPartialEq for ShieldValuePolicy
Auto Trait Implementations§
impl Freeze for ShieldValuePolicy
impl RefUnwindSafe for ShieldValuePolicy
impl Send for ShieldValuePolicy
impl Sync for ShieldValuePolicy
impl Unpin for ShieldValuePolicy
impl UnwindSafe for ShieldValuePolicy
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