pub struct Ring { /* private fields */ }Expand description
A annulus or closed annular sector with opposite-winding inner contour.
Implementations§
Source§impl Ring
impl Ring
Sourcepub fn new(center: Point, inner_radius: f64, outer_radius: f64) -> Self
pub fn new(center: Point, inner_radius: f64, outer_radius: f64) -> Self
Builds a complete ring with 0 <= inner <= outer.
Sourcepub fn sweep(self, start_angle: f64, sweep_angle: f64) -> Self
pub fn sweep(self, start_angle: f64, sweep_angle: f64) -> Self
Selects a clockwise-positive annular sector in radians; clamps to one turn.
Sourcepub fn try_path(&self) -> Result<Path2D, ValidationError>
pub fn try_path(&self) -> Result<Path2D, ValidationError>
Returns checked annular geometry; full rings retain a real winding hole.
Trait Implementations§
Source§impl Shape for Ring
impl Shape for Ring
Source§fn bounding_box(&self) -> Rect
fn bounding_box(&self) -> Rect
Geometric bounds; defaults to the path’s cached curve bounds.
Source§fn validate(&self) -> Result<(), ValidationError>
fn validate(&self) -> Result<(), ValidationError>
Reports retained authoring errors before measuring or drawing.
Source§fn as_rect(&self) -> Option<Rect>
fn as_rect(&self) -> Option<Rect>
Exact rectangle equivalent, when available, for a rule-independent fast path.
Auto Trait Implementations§
impl Forget for Ring
impl Freeze for Ring
impl RefUnwindSafe for Ring
impl Send for Ring
impl Sync for Ring
impl Unpin for Ring
impl UnsafeUnpin for Ring
impl UnwindSafe for Ring
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