pub struct MeterGeometry { /* private fields */ }Expand description
Immutable continuous geometry. Zero extents are valid (and paint nothing); positive extents must have representable edges. Negative origins are valid.
Implementations§
Source§impl MeterGeometry
impl MeterGeometry
pub fn new(bounds: Rect, value: MeterValue) -> Result<MeterGeometry, MeterError>
pub fn bounds(self) -> Rect
pub fn value(self) -> MeterValue
pub fn fill(self) -> Option<Rect>
Sourcepub fn markers_into(
self,
fractions: &[f64],
width: f32,
output: &mut [Rect],
) -> Result<usize, MeterError>
pub fn markers_into( self, fractions: &[f64], width: f32, output: &mut [Rect], ) -> Result<usize, MeterError>
Write threshold rectangles inside the track. Fractions must be finite in 0..=1, width positive and no wider than the track. Marker centers follow fraction * width; endpoint marks move inward just enough to fit. No value is clamped. All validation precedes writes; unused output stays unchanged. Empty input succeeds even on a zero-width track (width still validates).
Trait Implementations§
Source§impl Clone for MeterGeometry
impl Clone for MeterGeometry
Source§fn clone(&self) -> MeterGeometry
fn clone(&self) -> MeterGeometry
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 MeterGeometry
impl Debug for MeterGeometry
Source§impl PartialEq for MeterGeometry
impl PartialEq for MeterGeometry
impl Copy for MeterGeometry
impl StructuralPartialEq for MeterGeometry
Auto Trait Implementations§
impl Freeze for MeterGeometry
impl RefUnwindSafe for MeterGeometry
impl Send for MeterGeometry
impl Sync for MeterGeometry
impl Unpin for MeterGeometry
impl UnwindSafe for MeterGeometry
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