Struct comfy_wgpu::epaint::emath::Rangef
#[repr(C)]pub struct Rangef {
pub min: f32,
pub max: f32,
}Expand description
Includive range of floats, i.e. min..=max, but more ergonomic than RangeInclusive.
Fields§
§min: f32§max: f32Implementations§
§impl Rangef
impl Rangef
pub const EVERYTHING: Rangef = _
pub const EVERYTHING: Rangef = _
Infinite range that contains everything, from -∞ to +∞, inclusive.
pub const NOTHING: Rangef = _
pub const NOTHING: Rangef = _
The inverse of Self::EVERYTHING: stretches from positive infinity to negative infinity.
Contains nothing.
pub fn new(min: f32, max: f32) -> Rangef
pub fn span(&self) -> f32
pub fn contains(&self, x: f32) -> bool
Trait Implementations§
§impl From<&RangeInclusive<f32>> for Rangef
impl From<&RangeInclusive<f32>> for Rangef
§fn from(range: &RangeInclusive<f32>) -> Rangef
fn from(range: &RangeInclusive<f32>) -> Rangef
Converts to this type from the input type.
§impl From<&Rangef> for RangeInclusive<f32>
impl From<&Rangef> for RangeInclusive<f32>
§impl From<RangeInclusive<f32>> for Rangef
impl From<RangeInclusive<f32>> for Rangef
§fn from(range: RangeInclusive<f32>) -> Rangef
fn from(range: RangeInclusive<f32>) -> Rangef
Converts to this type from the input type.
§impl From<RangeToInclusive<f32>> for Rangef
impl From<RangeToInclusive<f32>> for Rangef
§fn from(range: RangeToInclusive<f32>) -> Rangef
fn from(range: RangeToInclusive<f32>) -> Rangef
Converts to this type from the input type.
§impl From<Rangef> for RangeInclusive<f32>
impl From<Rangef> for RangeInclusive<f32>
impl Copy for Rangef
impl Pod for Rangef
impl StructuralPartialEq for Rangef
Auto Trait Implementations§
impl RefUnwindSafe for Rangef
impl Send for Rangef
impl Sync for Rangef
impl Unpin for Rangef
impl UnwindSafe for Rangef
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
source§impl<T> CheckedBitPattern for Twhere
T: AnyBitPattern,
impl<T> CheckedBitPattern for Twhere T: AnyBitPattern,
§type Bits = T
type Bits = T
Self must have the same layout as the specified Bits except for
the possible invalid bit patterns being checked during
is_valid_bit_pattern.source§fn is_valid_bit_pattern(_bits: &T) -> bool
fn is_valid_bit_pattern(_bits: &T) -> bool
If this function returns true, then it must be valid to reinterpret
bits
as &Self.