pub struct VolumePolicy {
pub threshold: u8,
pub max_step: u8,
pub threshold_floor: bool,
}Expand description
Limits the session applies to a volume request.
A request at or below threshold is applied as asked, whether it
raises or lowers the level. Above the threshold, one request may raise the level by at most
max_step; a lower request is still applied as asked, because the
limit bounds raises only. The configuration validation rejects a policy that cannot describe a
valid level before a connection is attempted.
VolumePolicy::default is the rule clamp_volume implements, so a
host that does not configure a policy keeps the behaviour of earlier releases.
Fields§
§threshold: u8At or below this level a request is applied as is, in the protocol’s 0-100 range.
max_step: u8Above the threshold, at most this much may be added per command.
threshold_floor: boolWhether a request above the threshold may always rise to the threshold itself.
With false a low level creeps up by max_step per command, so
1 + a request for 100 yields 21. With true the same request yields the threshold, 40,
because a level below the threshold may always reach it in one step.
Trait Implementations§
Source§impl Clone for VolumePolicy
impl Clone for VolumePolicy
impl Copy for VolumePolicy
Source§impl Debug for VolumePolicy
impl Debug for VolumePolicy
Source§impl Default for VolumePolicy
impl Default for VolumePolicy
Source§fn default() -> Self
fn default() -> Self
Returns the policy clamp_volume implements.