pub struct Volume(/* private fields */);Expand description
Audio output volume, normalized 0.0..=1.0.
Implementations§
Source§impl Volume
impl Volume
Sourcepub fn new(value: f32) -> Result<Self, OutOfRange>
pub fn new(value: f32) -> Result<Self, OutOfRange>
Constructs a new value, validating the range.
§Errors
Returns OutOfRange if value is NaN or outside the
valid range.
Sourcepub const fn new_unchecked(value: f32) -> Self
pub const fn new_unchecked(value: f32) -> Self
Constructs without validation.
The caller must ensure value lies within the valid range.
Trait Implementations§
impl Copy for Volume
Source§impl PartialOrd for Volume
impl PartialOrd for Volume
impl StructuralPartialEq for Volume
Auto Trait Implementations§
impl Freeze for Volume
impl RefUnwindSafe for Volume
impl Send for Volume
impl Sync for Volume
impl Unpin for Volume
impl UnsafeUnpin for Volume
impl UnwindSafe for Volume
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